private Map<String, Long> findAllCurrentEndTimestamps(WindowState state) {

        Collection<SessionContainer> sessionContainerList = state.sessionMap.values();

        if (!state.sessionKeyEndTimeMap.isEmpty()) {
            state.sessionKeyEndTimeMap.clear();
        }

        for (SessionContainer sessionContainer : sessionContainerList) {
            //not getting empty session details
            if (sessionContainer.getCurrentSessionEndTimestamp() != -1) {
                state.sessionKeyEndTimeMap.put(sessionContainer.getKey(),
                        sessionContainer.getCurrentSessionEndTimestamp());
            }
        }

        return state.sessionKeyEndTimeMap;
    }
Gets all end timestamps of current sessions.

@param state current state
@return map with the values of each current session's end timestamp and with the key as the session key
modules/siddhi-core/src/main/java/io/siddhi/core/query/processor/stream/window/SessionWindowProcessor.java