### Question:
WebUiServer { public static void start(MonitorConfigurator monitorConfigurator, Coordinator coordinator, int port) throws Exception { Monitor monitor = new Monitor(coordinator, monitorConfigurator); WebUiServer server = new WebUiServer(coordinator, new ClientCache(coordinator), port); server.run(() -> { try { monitor.stop(); coordinator.close(); } catch (IOException e) { LOG.error("Error shutting down", e); } }); } WebUiServer(Coordinator coordinator,
                     IClientCache clientCache,
                     int port); static void main(String[] args); static void start(MonitorConfigurator monitorConfigurator,
                         Coordinator coordinator,
                         int port);  }### Answer:
@Test public void testShutdown() throws Exception { Coordinator coordinator = CoreConfigFixtures.createCoordinator( localTmpDir, getZkClientPort(), 5000, domainsRoot, domainGroupsRoot, ringGroupsRoot ); Thread webserverThread = new Thread(() -> { try { WebUiServer.start( new MockMonitorConfigurator(), coordinator, 34724 ); } catch (Exception e) { System.out.println(e); } }); webserverThread.start(); WaitUntil.orDie(() -> hankUIRunning()); ZooKeeperCoordinator zkCoord = (ZooKeeperCoordinator) coordinator; expireSession(zkCoord.getSessionId()); WaitUntil.orDie(() -> !hankUIRunning()); }