private StreamEvent copyEvents(StreamEvent events) {

        StreamEvent currentEvent = events;
        StreamEvent firstCopiedEvent = eventClonerHolder.getStreamEventCloner().copyStreamEvent(events);
        StreamEvent lastCopiedEvent = firstCopiedEvent;

        while (currentEvent.getNext() != null) {
            currentEvent = currentEvent.getNext();
            StreamEvent copiedStreamEvent = eventClonerHolder.getStreamEventCloner().copyStreamEvent(currentEvent);
            lastCopiedEvent.setNext(copiedStreamEvent);
            lastCopiedEvent = copiedStreamEvent;
        }
        return firstCopiedEvent;
    }
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