public void remove() {
        if (lastReturned == null) {
            throw new IllegalStateException();
        }
        if (previousToLastReturned != null) {
            previousToLastReturned.setNext(lastReturned.getNext());
        } else {
            first = (E) lastReturned.getNext();
            if (first == null) {
                last = null;
            }
        }
        lastReturned.setNext(null);
        lastReturned = null;
    }
Removes from the underlying collection the last element returned by the
iterator (optional operation).  This method can be called only once per
call to <tt>next</tt>.  The behavior of an iterator is unspecified if
the underlying collection is modified while the iteration is in
progress in any way other than by calling this method.

@throws UnsupportedOperationException if the <tt>remove</tt>
                                      operation is not supported by this Iterator.
@throws IllegalStateException         if the <tt>next</tt> method has not
                                      yet been called, or the <tt>remove</tt> method has already
                                      been called after the last call to the <tt>next</tt>
                                      method.
modules/siddhi-core/src/main/java/io/siddhi/core/event/ComplexEventChunk.java