PersistedSessionManager implements SessionManager<T> { @Override public T getSession(long id) { restoreAllSessionsIfNecessary(); return sessionMap.get(id); } 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 testGetSession() { final TwitterSession session = setupActiveSessionTest(); assertEquals(session, sessionManager.getSession(session.getId())); }
@Test public void testGetSession_multipleSessions() { final int count = 2; final List<TwitterSession> sessions = setupMultipleSessionsTest(count); for (int i = 0; i < count; i++) { final TwitterSession session = sessions.get(i); assertEquals(session, sessionManager.getSession(session.getId())); } }