jdk8 stream 流 集合去重 List 根据某字段去重 直接上代码 直接上代码 List = List.stream().collect(Collectors.collectingAndThen( Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(Zy::getSid))), ArrayList::new));