max abstract method

Optional<T> max([
  1. int comparator(
    1. T,
    2. T
    )?
])

Returns the maximum element of this stream according to the provided Comparator.

Example

final max = GenericStream.of([3, 1, 4, 1, 5])
    .max((a, b) => a.compareTo(b));

Implementation

Optional<T> max([int Function(T, T)? comparator]);