### Question:
HttpServer implements IServer { @Override public int getPort() { return port; } HttpServer(int port); @Override boolean start(); @Override boolean stop(); @Override int getPort();  }### Answer:
@Test public void testCreateServer() { IServer srv = ServerFactory.createServer(); assertTrue(srv.getPort() >= 1); assertTrue(srv.getPort() <= 65535); }
@Test public void testWinRegistryPortUpdate() throws IOException { if (OsUtils.isWindows()) { IServer srv = ServerFactory.createServer(); Path configFile = Paths.get(FileUtils.getTempDirectoryPath(), "PeerWasp-TestAppConfig.conf"); AppConfig appConfig = new AppConfig(configFile); appConfig.load(); appConfig.setApiServerPort(srv.getPort()); WinRegistryTest.assertPort(srv.getPort()); } else { fail("Not on Windows."); } }