@Override
        public void restore(Map<String, Object> state) {
            currentStateEventChunk.clear();
            currentStateEventChunk.add((StateEvent) state.get("FirstEvent"));
            pendingStateEventList = (LinkedList<StateEvent>) state.get("PendingStateEventList");
            newAndEveryStateEventList = (LinkedList<StateEvent>) state.get("NewAndEveryStateEventList");
            initialized = (Boolean) state.get("Initialized");
            started = (Boolean) state.get("Started");
        }
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