@Override
  public void hardStop() {
    if (nodeLifecycle.tryToMoveTo(HARD_STOPPING)) {
      LOG.info("Hard stopping SonarQube");
      hardStopImpl();
    }
  }
@Test
  public void awaitTermination_blocks_until_all_processes_are_stopped() throws Exception {
    TestAppSettings settings = new TestAppSettings();
    Scheduler underTest = startAll(settings);

    Thread awaitingTermination = new Thread(underTest::awaitTermination);
    awaitingTermination.start();
    assertThat(awaitingTermination.isAlive()).isTrue();

    underTest.hardStop();
    // the thread is being stopped
    awaitingTermination.join();
    assertThat(awaitingTermination.isAlive()).isFalse();
  }