code: @NotNull
      public Optional<T> max(@NotNull Comparator<? super T> comparator) {
          return reduce(BinaryOperator.Util.<T>maxBy(comparator));
      }
docs: Finds the maximum element according to the given comparator.
  
  <p>This is a terminal operation.
  
  <p>Example:
  <pre>
  comparator: (a, b) -&gt; a.compareTo(b)
  stream: [1, 2, 3, 4, 5]
  result: 5
  </pre>
  
  @param comparator  the {@code Comparator} to compare elements
  @return the maximum element