Code example for Iterator

Methods: remove

0
                if (value != NO_VALUE) {
                    throw new IllegalStateException("No last element");
                } 
 
                value = null;
                it.remove();
            } 
        }; 
    } 
 
    public boolean remove(Object object) {
        if (object == null) {
            return false; 
        } 
 
        Iterator<T> it = this.iterator();
        while (it.hasNext()) {
            if (object.equals(it.next())) {
                it.remove();
                return true; 
            }