public boolean hasNext() {
        if (lastReturned != null) {
            return lastReturned.getNext() != null;
        } else if (previousToLastReturned != null) {
            return previousToLastReturned.getNext() != null;
        } else {
            return first != null;
        }
    }
Returns <tt>true</tt> if the iteration has more elements. (In other
words, returns <tt>true</tt> if <tt>next</tt> would return an element
rather than throwing an exception.)

@return <tt>true</tt> if the iterator has more elements.
modules/siddhi-core/src/main/java/io/siddhi/core/event/ComplexEventChunk.java