code: public Optional<T> minByLong(ToLongFunction<? super T> keyExtractor) {
          return Box
                  .asOptional(reduce(null, (ObjLongBox<T> acc, T t) -> {
                      long val = keyExtractor.applyAsLong(t);
                      if (acc == null)
                          return new ObjLongBox<>(t, val);
                      if (val < acc.b) {
                          acc.b = val;
                          acc.a = t;
                      }
                      return acc;
                  }, (ObjLongBox<T> acc1, ObjLongBox<T> acc2) -> (acc1 == null || acc2 != null && acc1.b > acc2.b) ? acc2
                          : acc1));
      }
docs: Returns the minimum element of this stream according to the long values
  extracted by provided function. This is a special case of a reduction.
  
  <p>
  This is a terminal operation.
  
  <p>
  This method is equivalent to
  {@code min(Comparator.comparingLong(keyExtractor))}, but may work faster
  as keyExtractor function is applied only once per each input element.
  
  @param keyExtractor a <a
  href="package-summary.html#NonInterference">non-interfering </a>,
  <a href="package-summary.html#Statelessness">stateless</a>
  function to extract the long keys from this stream elements
  @return an {@code Optional} describing the minimum element of this
  stream, or an empty {@code Optional} if the stream is empty
  @throws NullPointerException if the minimum element is null