SessionManager { public boolean isSessionActive(final Long sessionId) { return SESSION_SEQ_START_VALUE <= sessionId && sessionId < sessionSequence.get(); }  boolean isSessionActive(final Long sessionId); Long createSession(); void registerEstimate(final Long sessionID, final Estimate estimate); List<Estimate> getResults(final Long sessionId); List<String> getSessionUsers(final Long sessionId); ListMultimap<Long, String> getSessions(); synchronized void clearSessions(); void resetSession(final Long sessionId); void registerUser(final String userName, final Long sessionId); void removeUser(String userName, Long sessionId); static final Long SESSION_SEQ_START_VALUE; }
@Test public void testIsSessionActive() throws Exception { sessionManager.createSession(); sessionManager.createSession(); assertFalse(sessionManager.isSessionActive(0L)); assertTrue(sessionManager.isSessionActive(1L)); assertTrue(sessionManager.isSessionActive(2L)); assertFalse(sessionManager.isSessionActive(3L)); }