class FilteringBatchIterator<T> extends ForwardingBatchIterator<T> {

    private final BatchIterator<T> delegate;
    private final Predicate<T> filter;

    public FilteringBatchIterator(BatchIterator<T> delegate, Predicate<T> filter) {
        this.delegate = delegate;
        this.filter = filter;
    }

    @Override
    protected BatchIterator<T> delegate() {
        return delegate;
    }

    @Override
    public boolean moveNext() {<FILL_FUNCTION_BODY>}
}

        while (delegate.moveNext()) {
            if (filter.test(delegate.currentElement())) {
                return true;
            }
        }
        return false;
    
<methods>public non-sealed void <init>() ,public T currentElement() ,public boolean hasLazyResultSet() <variables>