default ResultIterable<T> filter(Predicate<? super T> predicate) {
        Objects.requireNonNull(predicate, "Filter required");
        return () -> new ResultIteratorDelegate<T, T>(iterator()) {
            /** The next result (initially {@code null}). */
            private T next;

            /**
             * Returns {@code true} if the resultset has a {@code next} element.<br>
             * Repeatedly calling this method will move the resultset forward at most once.
             *
             * @return {@code true} if the resultset has another element
             */
            @Override
            public boolean hasNext() {
                return next != null || findNext();
            }

            /**
             * Returns the next result in the resultset.
             *
             * @return the next element in the resultset that passes the filter
             * @throws NoSuchElementException if the resultset has no more suitable elements
             */
            @Override
            public T next() {
                if (next == null && !findNext()) {
                    throw new NoSuchElementException("No more filtered results");
                }
                T n = next;
                next = null;
                return n;
            }

            /**
             * Forwards the resultset to the next result that passes the filter (i.e. {@link Predicate} tests {@code true}).<br>
             * @return true if another such result exists, false otherwise
             */
            @SuppressWarnings("PMD.UnusedAssignment")
            private boolean findNext() {
                next = null;
                while (getDelegate().hasNext()) {
                    T n = getDelegate().next();
                    if (predicate.test(n)) {
                        next = n;
                        return true;
                    }
                }
                return false;
            }
        };

    }
Convenience method to filter the {@link ResultIterable} by applying the specified {@link Predicate}.<br>
This method has the look and feel of {@link Stream#filter(Predicate)} without making use of streams.<p>

Please note that filtering takes place in Java i.e. your client code, <b>not in the database</b>.<br>
Filtering inside the database will most likely be of higher performance than filtering outside,
as intermediate results are loaded into Java and then discarded. Moreover, indexes that may exist
in the database will not be utilized here.

@param predicate a non-null predicate to apply to each element
                 to determine whether it should be included in the result
@return the new result iterable

@since 3.31
core/src/main/java/org/jdbi/v3/core/result/ResultIterable.java