code: public OptionalDouble max(Comparator<Double> comparator) {
          return reduce((a, b) -> comparator.compare(a, b) >= 0 ? a : b);
      }
docs: Returns the maximum element of this stream according to the provided
  {@code Comparator}.
  
  <p>
  This is a terminal operation.
  
  @param comparator a non-interfering, stateless {@link Comparator} to
  compare elements of this stream
  @return an {@code OptionalDouble} describing the maximum element of this
  stream, or an empty {@code OptionalDouble} if the stream is empty