### Question:
EmbeddedWebServer { public void stop() throws IOException { try { server.stop(); } catch (Exception e) { LOG.error("Error stopping HTTP Server", e); throw new IOException("Unable to stop HTTP Server", e); } } EmbeddedWebServer(int port); private  EmbeddedWebServer(Server server); @VisibleForTesting  EmbeddedWebServer(Server server, Context context); void start(); boolean isRunning(); void stop(); void waitForShutdown();  }### Answer:
@Test public void stop() throws Exception { server.stop(); replayAll(); webServer().stop(); }
@Test public void stop_exception() throws Exception { final Exception exception = new Exception(); server.stop(); expectLastCall().andThrow(exception); replayAll(); try { webServer().stop(); fail("Expected IOException"); } catch (IOException e) { assertEquals(exception, e.getCause()); } }