@NotNull
    public OptionalLong filter(@NotNull LongPredicate predicate) {
        if (!isPresent()) return this;
        return predicate.test(value) ? this : OptionalLong.empty();
    }
@ NotNull public OptionalLong filter ( @ NotNull LongPredicate predicate ) { if ( ! isPresent ( ) ) return this ; return predicate . test ( value ) ? this : OptionalLong . empty ( ) ; }
Performs filtering on inner value if it is present.

@param predicate  a predicate function
@return this {@code OptionalLong} if the value is present and matches predicate,
otherwise an empty {@code OptionalLong}