public E next() {
        E returnEvent;
        if (lastReturned != null) {
            returnEvent = (E) lastReturned.getNext();
            previousToLastReturned = lastReturned;
        } else if (previousToLastReturned != null) {
            returnEvent = (E) previousToLastReturned.getNext();
        } else {
            returnEvent = first;
        }
        if (returnEvent == null) {
            throw new NoSuchElementException();
        }
        lastReturned = returnEvent;
        return returnEvent;
    }
Returns the next element in the iteration.

@return the next element in the iteration.
@throws java.util.NoSuchElementException iteration has no more elements.
modules/siddhi-core/src/main/java/io/siddhi/core/event/ComplexEventChunk.java