去重
List<PolicySalaryVO> policySalaryVO = policySalaryDTOList
.stream()
.map(PolicySalaryVO::new)
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(PolicySalaryVO::getType))), ArrayList::new));
分组
Map<Integer, List<PolicySalaryVO>> policySalaryDTOList2 = policySalaryDTOList
.stream()
.map(PolicySalaryVO::new)
.collect(Collectors.groupingBy(PolicySalaryVO::getType));
打印数组
Arrays.asList(cmowers).stream().forEach(s -> System.out.println(s));
Stream.of(cmowers).forEach(System.out::println);
Arrays.stream(cmowers).forEach(System.out::println);
System.out.println(Arrays.toString(cmowers));
多维数组
System.out.println(Arrays.deepToString(deepArray));