jdk8 List 新特性

public class MainTest {

    @Test
    public void main() {
        int i = 0;
        IntStream.range(0, 10).forEach(
                rang -> System.out.printf("生成第%d个表sql:%s\n", rang, "qsdafads")
        );
    }

    @Test
    public void test1() {
        List<Integer> list = Lists.newArrayList(1, 2, 3, 4, 5, 4, 32, 1, null, 1);
        list.stream().distinct()
                .filter(num -> num != null && num != 1)
                .mapToInt(num -> num * 7)
                .skip(2).limit(1).forEach(System.out::println);

    }
}

  

posted @ 2020-08-19 18:16  BigWrite  阅读(277)  评论(0编辑  收藏  举报