list中根据某个字段去除重复值
ArrayList<ENTITY> newList = list.stream().collect
(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
Comparator.comparing(ENTITY::getId))), ArrayList::new));
————————————————
ArrayList<ENTITY> newList = list.stream().collect
(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
Comparator.comparing(ENTITY::getId))), ArrayList::new));
————————————————