Lambda操作
1、对集合根据某字段进行去重
List<OrgVideoTreeDto> orgDemoList = orgDemoList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() ->
new TreeSet<>(Comparator.comparing(OrgVideoTreeDto :: getId))),ArrayList :: new));
//非对象集合去重
List<String> list = list.stream().,distinct().collect(Collectors.toList());

浙公网安备 33010602011771号