Lamda 表达式

从List<User> 中获取 age最大的对象 

Optional<User> optional= list.stream().max(Comparator.comparing(User ::getAge));
User maxEndCount = optional.get();

原文地址:https://www.cnblogs.com/feathe/p/12802599.html