public OptionalInt maxByInt(IntUnaryOperator keyExtractor){
  int[] result=collect(null,null,null);
  return result[2] == 1 ? OptionalInt.of(result[0]) : OptionalInt.empty();
}

public OptionalInt maxByInt ( IntUnaryOperator keyExtractor ) { int [ ] result = collect ( null , null , null ) ; return result [ 2 ] == 1 ? OptionalInt . of ( result [ 0 ] ) : OptionalInt . empty ( ) ; }
returns the maximum element of this stream according to the provided key extractor function . < p > this is a terminal operation .
