Java8 list根据一个字段去重(记录)

list = list.stream().collect(
                Collectors.collectingAndThen(
                        Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InformationDetailVo::getCategoryId))), ArrayList::new));
        

猜你喜欢

转载自blog.csdn.net/wangh92/article/details/83339132