### Question:
HessianService extends HttpRemoteService { @Override protected HttpSession getSession(boolean create) { HttpServletRequest request = (HttpServletRequest) ServiceContext .getContextRequest(); if (request == null) { throw new IllegalStateException( "Attempt to access HttpSession outside the request scope."); } return request.getSession(create); } HessianService(@Inject ObjectContextFactory contextFactory,
            @Inject(Constants.SERVER_ROP_EVENT_BRIDGE_PROPERTIES_MAP) Map<String, String> eventBridgeProperties);  static final String[] SERVER_SERIALIZER_FACTORIES; }### Answer:
@Test public void testGetSession() throws Exception { Map<String, String> map = new HashMap<>(); map.put(Constants.SERVER_ROP_EVENT_BRIDGE_FACTORY_PROPERTY, MockEventBridgeFactory.class.getName()); ObjectContextFactory factory = new ObjectContextFactory() { public ObjectContext createContext(DataChannel parent) { return null; } public ObjectContext createContext() { return null; } }; HessianService service = new HessianService(factory, map); MockHttpServletRequest request = new MockHttpServletRequest(); HttpSession session = new MockHttpSession(); request.setSession(session); request.getSession(); try { ServiceContext.begin(request, null, null, null); assertSame(session, service.getSession(false)); } finally { ServiceContext.end(); } }