### Question:
SessionManager { public abstract LoginSession getSession(String id);  static synchronized SessionManager get(); abstract LoginSession getSession(String id); abstract LoginSession newSession(Login login, long expires); abstract LoginSession newSession(Login login);  }### Answer:
@Test public void testGetSession() throws Exception { Configuration conf = new HASConfiguration(); conf.set(HASConfiguration.HADOOP_SECURITY_TOKENAUTH_AUTHENTICATORS_KEY, "simple"); LoginSession session; Login login; login = new LoginImpl(conf); session = SessionManager.get().newSession(login); long createTime = session.getCreationTime(); String sessionID = session.getId(); System.out.println("creationTime: " + createTime); System.out.println("sessionID: " + sessionID); session = SessionManager.get().getSession(sessionID); assertEquals(createTime, session.getCreationTime()); assertEquals(sessionID, session.getId()); }