GrizzlySessionManager implements SessionManager { protected Session asSession(final HttpSession entity) { if (entity == null) { return null; } GrizzlySession s = new GrizzlySession(); s.setIdInternal(IdUtil.toString(entity.getId())); s.setCreationTime(entity.getCreatedDate().getTimeInMillis()); s.setTimestamp(entity.getModifiedDate().getTimeInMillis()); s.setSessionTimeout(entity.getSessionTimeout()); return s; } @Inject  GrizzlySessionManager(final SystemConfiguration c,
                                 final Provider<SessionFactory> sfProvider); @Override Session getSession(final Request request,
                              final String requestedSessionId); @Override Session createSession(final Request request); @Override String changeSessionId(final Request request,
                                  final Session session); @Override String getSessionCookieName(); @Override void setSessionCookieName(final String name); @Override void configureSessionCookie(final Request request,
                                       final Cookie cookie);  }
@Test public void testAsSession() { assertNull(manager.asSession(null)); HttpSession s = new HttpSession(); s.setId(IdUtil.next()); s.setCreatedDate(Calendar.getInstance()); s.setModifiedDate(Calendar.getInstance()); s.setSessionTimeout(1000); Session result = manager.asSession(s); ensureSessionsMatch(s, result); }