SessionManager { public synchronized void clearSessions() { logger.info("Clearing all sessions"); sessionUsers.clear(); sessionEstimates.clear(); sessionSequence.set(SESSION_SEQ_START_VALUE); }  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 testClearSessions() { final Long sessionId = sessionManager.createSession(); sessionManager.registerUser("Rich", sessionId); sessionManager.registerEstimate(sessionId, new Estimate("Rich", "8")); sessionManager.clearSessions(); assertTrue(sessionManager.getResults(sessionId).isEmpty()); assertTrue(sessionManager.getSessionUsers(sessionId).isEmpty()); assertEquals(sessionId, sessionManager.createSession()); }