public void overwrite(StreamEvent streamEvent) {
        if (!isFullSnapshot()) {
            if (isOperationLogEnabled) {
                operationChangeLog.add(new Operation(Operator.OVERWRITE,
                        new Object[]{eventIndex,
                                eventClonerHolder.getStreamEventCloner().copyStreamEvent(streamEvent)}));
            }
            operationChangeLogSize++;
        } else {
            operationChangeLog.clear();
            operationChangeLogSize = 0;
            forceFullSnapshot = true;
        }

        if (previousToLastReturned != null) {
            previousToLastReturned.setNext(streamEvent);
        } else {
            first = streamEvent;
        }
        StreamEvent next = lastReturned.getNext();
        if (next != null) {
            streamEvent.setNext(next);
        } else {
            last = streamEvent;
        }
        lastReturned = streamEvent;
    }
Returns the next element in the iteration.

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