ArrayList<DriverlessCarLink> collect = logisticsLink.stream().collect(
Collectors.collectingAndThen(
Collectors.toCollection(() -> new TreeSet<>(
Comparator.comparing(p -> p.getLinkNo()))), ArrayList::new));
java用stream根据对象的某个字段对list进行去重
最新推荐文章于 2024-10-30 18:07:32 发布