code: public <V extends Comparable<? super V>> OptionalInt maxBy(IntFunction<V> keyExtractor) {
          ObjIntBox<V> result = collect(() -> new ObjIntBox<>(null, 0), (box, i) -> {
              V val = Objects.requireNonNull(keyExtractor.apply(i));
              if (box.a == null || box.a.compareTo(val) < 0) {
                  box.a = val;
                  box.b = i;
              }
          }, (box1, box2) -> {
              if (box2.a != null && (box1.a == null || box1.a.compareTo(box2.a) < 0)) {
                  box1.a = box2.a;
                  box1.b = box2.b;
              }
          });
          return result.a == null ? OptionalInt.empty() : OptionalInt.of(result.b);
      }
docs: Returns the maximum element of this stream according to the provided key
  extractor function.
  
  <p>
  This is a terminal operation.
  
  @param <V> the type of the {@code Comparable} sort key
  @param keyExtractor a non-interfering, stateless function
  @return an {@code OptionalInt} describing the first element of this
  stream for which the highest value was returned by key extractor,
  or an empty {@code OptionalInt} if the stream is empty
  @since 0.1.2