list.stream()
.collect(
Collectors.collectingAndThen(
Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(e -> e.getId))
), ArrayList::new
)
);
标签:Stream,Collectors,stream,过滤,某个,new From: https://www.cnblogs.com/ZDY-XJ/p/17485983.html
list.stream()
.collect(
Collectors.collectingAndThen(
Collectors.toCollection(
() -> new TreeSet<>(Comparator.comparing(e -> e.getId))
), ArrayList::new
)
);
标签:Stream,Collectors,stream,过滤,某个,new From: https://www.cnblogs.com/ZDY-XJ/p/17485983.html