SessionHelpers { static SessionTracking trackingFromEnum(String sessionTracking) throws InstantiationException, IllegalAccessException { try { SessionPropagation sp = SessionPropagation.valueOf(sessionTracking); return sp.get(); } catch (IllegalArgumentException e) { logger.debug( "The argument for session propagation was not enumration, " + "it is probably class name: {}, message: {}", sessionTracking, e); return null; } }  ServletRequest prepareRequest(ServletRequest request, ServletResponse response,
      ServletContext originalServletContext); ServletResponse prepareResponse(ServletRequest request, ServletResponse response); MethodHandle[] initSessionManagement(ServletContext servletContext); MethodHandle[] initSessionManagement(ServletContext servletContext, boolean reset); void commitRequest(ServletRequest request, ServletRequest oldRequest); @SuppressWarnings("unchecked") void interceptHttpListener(EventListener caller, HttpSessionEvent event); void onAddListener(ServletContext servletContext, Object listener);  }
@Test public void testTrackingFromEnum() throws InstantiationException, IllegalAccessException { SessionTracking tracking = SessionHelpers.trackingFromEnum("URL"); assertTrue("Expecting instance of UrlSessionTracking", tracking instanceof UrlSessionTracking); tracking = SessionHelpers.trackingFromEnum("DEFAULT"); assertTrue("Expecting instance of CookieSessionTracking", tracking instanceof CookieSessionTracking); tracking = SessionHelpers.trackingFromEnum("COOKIE"); assertTrue("Expecting instance of CookieSessionTracking", tracking instanceof CookieSessionTracking); tracking = SessionHelpers.trackingFromEnum("BAD"); assertNull(tracking); }