天天看点

Sream流处理List对象集合根据其中某个字段去重

userList = userList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(User::getUserid))), ArrayList::new));

继续阅读