### Question:
SessionManager extends ConcurrentHashMap<String, Session> { public void kill(String sid) { Session session = get(sid); if (session != null) { session.setClosed(); log.warn("Killed session {}", sid); storeSession(session); for (SessionListener listener : listeners) try { listener.onSessionClosed(sid); } catch (Throwable t) { log.warn(t.getMessage(), t); } } } private  SessionManager(); final static SessionManager get(); synchronized Session newSession(String username, String password, String key, Client client); synchronized Session newSession(String username, String password, Client client); synchronized Session createSession(User user, Client client); void kill(String sid); @Override Session remove(Object sid); void renew(String sid); int getStatus(String sid); boolean isOpen(String sid); @Override Session get(Object sid); Session getByClientId(String clientId); int countOpened(); int countOpened(long tenantId); List<Session> getSessions(); Session getSession(HttpServletRequest request); String getSessionId(HttpServletRequest request); void saveSid(HttpServletRequest request, HttpServletResponse response, String sid); void removeSid(HttpServletRequest request); static String getCurrentSid(); HttpSession getServletSession(String sid); Client buildClient(HttpServletRequest req); void setAuthenticationChain(AuthenticationChain authenticationChain); void destroy(); SessionDAO getSessionDao(); void setSessionDao(SessionDAO sessionDao); synchronized void addListener(SessionListener listener); synchronized void removeListener(SessionListener listener); static final String COOKIE_SID; static final String PARAM_SID; }### Answer:
@Test public void testKill() { SessionManager sm = SessionManager.get(); sm.clear(); Session session1 = sm.newSession("admin", "admin", null); Assert.assertNotNull(session1); Session session2 = sm.newSession("admin", "admin", null); Assert.assertNotNull(session2); Assert.assertFalse(session1.equals(session2)); Assert.assertEquals(2, sm.getSessions().size()); sm.kill(session1.getSid()); Assert.assertTrue(sm.isOpen(session2.getSid())); Assert.assertTrue(!sm.isOpen(session1.getSid())); Assert.assertEquals(2, sm.getSessions().size()); }