### Question:
HttpServerProvider implements ServerProvider<HttpServer>, ServerCreator<HttpServer> { @Override public HttpServer createServer(URL url) { int port = url.getPort() <= 0 ? url.getDefaultPort() : url.getPort(); return createServer(url.getHost(), url.getProtocol(), port); } HttpServerProvider(Toolbox toolbox, ServerFactory factory); @Override void addServerChangedListener(ServerChangedListener<HttpServer> listener); @Override synchronized void clearServers(); void close(); @Override HttpServer createServer(URL url); @Override synchronized HttpServer getServer(String host, String protocol, int port); @Override HttpServer getServer(URL url); @Override void removeServerChangedListener(ServerChangedListener<HttpServer> listener);  }### Answer:
@Test public void testCreateServer() throws GeneralSecurityException, IOException { EasyMockSupport support = new EasyMockSupport(); Toolbox toolbox = createToolbox(support); HttpServer server = support.createMock(HttpServer.class); HttpServer storedServer = support.createMock(HttpServer.class); int port = 1000; String serverKey = ourHost + ':' + port; ServerFactory factory = createFactory(support, port, serverKey, toolbox, server); EasyMock.expect(factory.createServer(EasyMock.isA(SecurityComponentsProviderImpl.class), EasyMock.cmpEq(ourProtocol), EasyMock.cmpEq(ourHost), EasyMock.eq(port), EasyMock.cmpEq(serverKey), EasyMock.eq(toolbox))) .andReturn(storedServer); support.replayAll(); URL url = new URL(ourProtocol + ": HttpServerProvider provider = new HttpServerProvider(toolbox, factory); HttpServer actualServer = provider.createServer(url); assertEquals(server, actualServer); HttpServer actualStoredServer = provider.getServer(url); assertEquals(storedServer, actualStoredServer); support.verifyAll(); }