TestCollectionString.java 1.15 KB
Newer Older
yanzg's avatar
yanzg committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
package helper;

import base.DemoVo;
import com.yanzuoguang.util.base.CollectionString;
import com.yanzuoguang.util.helper.StringHelper;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class TestCollectionString {

    @Test
    public void testCh() {
        List<DemoVo> mapList = new ArrayList<>(Arrays.asList(
                new DemoVo("1", "颜佐光"),
                new DemoVo("10000", "成吉思汗"),
                new DemoVo("10001", "毛泽东")
        ));
        System.out.println(CollectionString.getCollectionString("人名:", mapList));
        System.out.println(CollectionString.getCollectionString(StringHelper.EMPTY, mapList));
    }


    @Test
    public void testEn() {
        List<DemoVo> mapList = new ArrayList<>(Arrays.asList(
                new DemoVo("1", "yan zuo guang"),
                new DemoVo("10000", "chen jie si han"),
                new DemoVo("10001", "mao ze dong")
        ));
        System.out.println(CollectionString.getCollectionString(StringHelper.EMPTY, mapList));

        System.out.println(CollectionString.getCollectionString("人名:", mapList));

    }
}