class IteratorDecorator<U, T> implements Iterator<T> {

        private final Iterator<U> source;
        private final Function<U, T> transform;
        private final Predicate<U> filter;
        private T next = null;

        public IteratorDecorator(Iterator<U> source, Function<U, T> transform, Predicate<U> filter) {
            this.source = source;
            this.transform = transform;
            this.filter = filter;
        }

        public boolean hasNext() {
            this.maybeFetchNext();
            return next != null;
        }

        public T next() {
            if (next == null) {
                throw new NoSuchElementException();
            }
            T val = next;
            next = null;
            return val;
        }

        private void maybeFetchNext() {<FILL_FUNCTION_BODY>}

        public void remove() {
            throw new UnsupportedOperationException();
        }
    }

            if (next == null) {
                if (source.hasNext()) {
                    U val = source.next();
                    if (filter.test(val)) {
                        next = transform.apply(val);
                    }
                }
            }
        
<no_super_class>