Returns a Collector
that produces the maximal element according
to a given Comparator
, described as an Optional<T>
.
<T> | the type of the input elements | |
comparator | a Comparator for comparing elements |
Collector
that produces the maximal value
@implSpec This produces a result equivalent to:
reducing(BinaryOperator.maxBy(comparator))
Diagram: Collectors