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()
With stream and reduce
Optional max = list.stream().reduce(Math::max);