从List<User> 中获取 age最大的对象
Optional<User> optional= list.stream().max(Comparator.comparing(User ::getAge));
User maxEndCount = optional.get();
从List<User> 中获取 age最大的对象
Optional<User> optional= list.stream().max(Comparator.comparing(User ::getAge));
User maxEndCount = optional.get();