public synchronized boolean isServing() {
    return mWebServer != null && mWebServer.getServer().isRunning();
  }
@Test
  public void alwaysOnTest() {
    Configuration.set(PropertyKey.STANDBY_MASTER_WEB_ENABLED, true);
    WebServerService webService =
        WebServerService.Factory.create(mWebAddress, mMasterProcess);
    Assert.assertTrue(webService instanceof AlwaysOnWebServerService);
    Assert.assertTrue(waitForFree());

    Assert.assertFalse(webService.isServing());
    webService.start();
    Assert.assertTrue(webService.isServing());
    Assert.assertTrue(isBound());
    for (int i = 0; i < 5; i++) {
      webService.promote();
      Assert.assertTrue(webService.isServing());
      Assert.assertTrue(isBound());
      webService.demote();
      Assert.assertTrue(webService.isServing());
      Assert.assertTrue(isBound());
    }
    webService.stop();
    Assert.assertTrue(waitForFree());
    Assert.assertFalse(webService.isServing());
  }