@Override
        public Map<String, Object> snapshot() {
            Map<String, Object> state = new HashMap<>();
            state.put("FirstEvent", currentStateEventChunk.getFirst());
            state.put("PendingStateEventList", pendingStateEventList);
            state.put("NewAndEveryStateEventList", newAndEveryStateEventList);
            state.put("Initialized", initialized);
            state.put("Started", started);
            return state;
        }
Set as the last element of the processor chain

@param processor Last processor in the chain
modules/siddhi-core/src/main/java/io/siddhi/core/query/input/stream/state/StreamPreStateProcessor.java