I have a list of Integer list and from the list.stream() I want the maximum value. What is the simplest way? Do I need comparator?
Integer
list
list.stream()
Another version could be:
int maxUsingCollectorsReduce = list.stream().collect(Collectors.reducing(Integer::max)).get();