### Question:
SimpleHttpsServer implements Callable<Integer> { public void stop(int timeoutMillis) { running = false; if (debug) { System.err.println("Stopping the HTTPS server (timeout " + timeoutMillis + " ms)"); } httpsServer.stop(timeoutMillis); }  Integer call(); static void main(String[] args); void stop(int timeoutMillis);  }### Answer:
@Test public void testHttps() throws IOException, InterruptedException { PrintStream oldOut = System.out; ByteArrayOutputStream baos = new ByteArrayOutputStream(); SimpleHttpsServer server = new SimpleHttpsServer(); try { System.setOut(new PrintStream(baos)); new CommandLine(server).execute("--port=7999"); String expected = String.format("Server started OK on port 7999%n"); assertEquals(expected, baos.toString()); baos = new ByteArrayOutputStream(); System.setOut(new PrintStream(baos)); new CommandLine(new SimpleHttpsClient()).execute("--use-local-keystore", "https: String expectedPrefix = String.format("" + "Response Code : 200%n" + "Cipher Suite : "); String expectedPostfix = String.format("" + "%n" + "Cert Type : X.509%n" + "Cert Hash Code : -2137823083%n" + "Cert Public Key Algorithm : RSA%n" + "Cert Public Key Format : X.509%n" + "%n" + "****** Content of the URL ********%n" + "You asked for /; This is the response%n"); String actualClientOut = baos.toString(); assertTrue(actualClientOut.startsWith(expectedPrefix), actualClientOut); assertTrue(actualClientOut.endsWith(expectedPostfix), actualClientOut); } finally { server.stop(1); System.setOut(oldOut); } }