//day 为user的一个属性
List<User> setList = eachUser.stream()
.collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(User::getDay))), ArrayList::new));

 

相关文章:

  • 2021-06-18
  • 2021-05-20
  • 2022-02-09
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-10
  • 2021-12-11
  • 2022-02-27
  • 2022-12-23
  • 2022-02-06
  • 2018-04-28
相关资源
相似解决方案