Code example for Iterator

Methods: remove

0
    public Iterator<T> iterator() {
        return new Iterator<T>() {
            private final Iterator<T> itty = iterable.iterator();
 
            public void remove() { 
                this.itty.remove();
            } 
 
            public T next() { 
                return this.itty.next();
            } 
 
            public boolean hasNext() { 
                return this.itty.hasNext();
            } 
        }; 
    } 
 
    public void close() { 
        if (this.iterable instanceof CloseableIterable) {
            ((CloseableIterable) this.iterable).close();