public static @NonNull OptionalDouble map(final @NonNull OptionalDouble optional, final @NonNull DoubleUnaryOperator operator) {
    requireNonNull(operator, "operator");
    return optional.isPresent() ? OptionalDouble.of(operator.applyAsDouble(optional.getAsDouble())) : OptionalDouble.empty();
  }
public static @ NonNull OptionalDouble map ( final @ NonNull OptionalDouble optional , final @ NonNull DoubleUnaryOperator operator ) { requireNonNull ( operator , "operator" ) ; return optional . isPresent ( ) ? OptionalDouble . of ( operator . applyAsDouble ( optional . getAsDouble ( ) ) ) : OptionalDouble . empty ( ) ; }
Apply the provided mapping operator to the {@code optional} if a value is present,
and return an {@code OptionalDouble} describing the result.

@param optional the optional
@param operator the operator
@return an optional