通过stream获取list中日期最大的对象

 

Optional<Object> max = collect.stream().max(Comparator.comparing(Object::getDate()));
Object object = max.get();

 

posted @ 2022-11-30 17:17  oO星芒蝶翼Oo  阅读(3389)  评论(0编辑  收藏  举报