DefaultWebApplicationServer implements HttpServerProcessor, WebApplicationServer { public void addMapping(String servletContextName, String contextPath) { Iterator<WebApplication> webApps = webApplications.values().iterator(); while (webApps.hasNext()) { WebApplication webApp = webApps.next(); if (webApp.getServletContextName().equals(servletContextName)) { requestMapper.addMapping(webApp, contextPath); break; } } } DefaultWebApplicationServer(); void addMapping(String servletContextName, String contextPath); @Override void addWebApplication(WebApplication webApplication); WebApplicationServerResponse createResponse(HttpServerResponse httpResponse); @Override WebApplicationServerRequestMapper getRequestMapper(); @Override void initialize(); @Override boolean process(HttpServerRequest request, HttpServerResponse response); @Override void service(WebApplicationServerRequest request, WebApplicationServerResponse response); @Override void setRequestMapper(WebApplicationServerRequestMapper requestMapper); @Override void start(); @Override void stop();  }
@Test void testAddMapping() { DefaultWebApplicationServer server = new DefaultWebApplicationServer(); DefaultWebApplication webApp = new DefaultWebApplication(); webApp.setServletContextName("mycontext"); server.addWebApplication(webApp); server.addMapping("notthere", "notreal"); }