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

list = list.stream().collect(
                Collectors.collectingAndThen(
                        Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(InformationDetailVo::getCategoryId))), ArrayList::new));
        
posted @ 2018-10-24 09:49  qwer78  阅读(103)  评论(0)    收藏  举报