根据某一字段List去重

List list = oldList.stream()
.collect(Collectors
.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(BomDemandProductVO::getId))), ArrayList::new));

posted @ 2022-11-17 15:33  性感的章鱼哥  阅读(83)  评论(0)    收藏  举报