### Question:
ContextFactory { public static Context create(final SessionManagerConfig config) { final Class<? extends Context> contextClass = getContextClass(config); final Context context = getNewInstance(contextClass); context.configure(config); return context; } private  ContextFactory(); static Context create(final SessionManagerConfig config); static Class<?> getClassForName(final String contextClassName);  }### Answer:
@Test public void initializesContextClass() { SessionManagerConfig config = new SessionManagerConfig("Test").setContext(DummyContext.class.getName()); Context context = ContextFactory.create(config); assertNotNull(context); assertEquals(DummyContext.class, context.getClass()); }
@Test(expected = ConfigurationException.class) public void throwsExceptionWhenGivenContextClassDoesNotExtendContext() { SessionManagerConfig config = new SessionManagerConfig("Test").setContext(String.class.getName()); ContextFactory.create(config); }