title: Difference between stream.max(Comparator) and stream.collect(Collectors.maxBy(Comparator) in Java
body: <p>In Java Streams - what is the difference between <code>stream.max(Comparator)</code> and <code>stream.collect(Collectors.maxBy(Comparator))</code> in terms of preformance. Both will fetch the max based on the comparator being passed. If this is the case why do we need the additional step of collecting using the collect method? When should we choose former vs latter? What are the use case scenarios suited for using both?</p>