sourceList->数据源
分组
Map<String, List<T>> prodMap = sourceList.stream().
collect(Collectors.groupingBy(item -> item.get分组的属性 + "_" + item.get分组属性));
去重
List<T> newList = sourceList.stream().collect(
Collectors.collectingAndThen(Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(o -> o.get去重属性()+";"+o.get去重属性()+";"+o.get去重属性()))), ArrayList::new));