@Nonnull
    public<U> NullableOptional<U> flatMap(@Nonnull Function<? super T, NullableOptional<U>> mapper) {
        Objects.requireNonNull(mapper);
        if (!isPresent())
            return empty();
        else {
            return Objects.requireNonNull(mapper.apply(this.value));
        }
    }
If a value is present, apply the provided {@code NullableOptional}-bearing
mapping function to it, return that result, otherwise return an empty
{@code NullableOptional}.  This method is similar to {@link #map(Function)},
but the provided mapper is one whose result is already an {@code NullableOptional},
and if invoked, {@code flatMap} does not wrap it with an additional
{@code NullableOptional}.

@param <U> The type parameter to the {@code NullableOptional} returned by
@param mapper a mapping function to apply to the value, if present
          the mapping function
@return the result of applying an {@code NullableOptional}-bearing mapping
function to the value of this {@code NullableOptional}, if a value is present,
otherwise an empty {@code NullableOptional}
@throws NullPointerException if the mapping function is null or returns
a null result
helper/src/main/java/me/lucko/helper/utils/NullableOptional.java