PersistedSessionManager implements SessionManager<T> { @Override public void clearActiveSession() { restoreAllSessionsIfNecessary(); if (activeSessionRef.get() != null) { clearSession(activeSessionRef.get().getId()); } } PersistedSessionManager(PreferenceStore preferenceStore,
            SerializationStrategy<T> serializer, String prefKeyActiveSession,
            String prefKeySession);   PersistedSessionManager(PreferenceStore preferenceStore,
            SerializationStrategy<T> serializer, ConcurrentHashMap<Long, T> sessionMap,
            ConcurrentHashMap<Long, PreferenceStoreStrategy<T>> storageMap,
            PreferenceStoreStrategy<T> activesSessionStorage,
            String prefKeySession); @Override T getActiveSession(); @Override void setActiveSession(T session); @Override void clearActiveSession(); @Override T getSession(long id); @Override void setSession(long id, T session); @Override Map<Long, T> getSessionMap(); @Override void clearSession(long id);  }
@Test public void testClearActiveSession() { setupActiveSessionTest(); sessionManager.clearActiveSession(); assertMapSizes(0); verify(mockActiveSessionStorage).clear(); assertNull(sessionManager.getActiveSession()); }
@Test public void testClearActiveSession_noActiveSession() { try { sessionManager.clearActiveSession(); } catch (Exception e) { fail(); } }