### Question:
EmbeddedWebServer { public void waitForShutdown() throws InterruptedException { server.join(); } 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 waitForShutdown() throws Exception { server.join(); replayAll(); webServer().waitForShutdown(); }
@Test(expected = InterruptedException.class) public void waitForShutdown_interrupted() throws Exception { server.join(); expectLastCall().andThrow(new InterruptedException()); replayAll(); webServer().waitForShutdown(); }