code: public Optional<T> filter(final Predicate<? super T> predicate) {
          if (isPresent() && predicate.test(get())) {
              return this;
          }
  
          return empty();
      }
docs: Apply a predicate to the optional, if the optional is present, and the predicate is true, return the optional, otherwise
  return empty.
  
  @param predicate the predicate to apply
  @return the optional if the predicate is true, empty if not
  @since 1.7