stream根据字段去重

//根据object去重
            ArrayList statisticsArrayList1 = statisticsList1.stream()
                    .collect(Collectors.collectingAndThen
                            (Collectors.toCollection(() ->
                                    new TreeSet<>(Comparator.comparing(Statistics::getObject))), ArrayList::new));

你可能感兴趣的:(JAVA,后端,技术)