List<EmEventConfigPointExcelDto> listNew = list.stream() .collect(Collectors.collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing((o) -> o.getTaskType() + ";" + o.getArea() + ";" + o.getSceneName() + ";" + o.getPointPosition() + ";" + o.getLocation()))), ArrayList::new));
标签:java,stream,Collectors,list,分组,new From: https://www.cnblogs.com/kkvt/p/17418635.html