code: public static @NonNull OptionalInt mapToInt(final @NonNull OptionalDouble optional, final @NonNull DoubleToIntFunction function) {
      requireNonNull(function, "function");
      return optional.isPresent() ? OptionalInt.of(function.applyAsInt(optional.getAsDouble())) : OptionalInt.empty();
    }
docs: Apply the provided mapping function to the {@code optional} if a value is present,
  and return an {@code OptionalInt} describing the result.
  
  @param optional the optional
  @param function the function
  @return an optional