void tryStartApp() throws Exception {
    final boolean shutdown = runExecutable(preconditionChecker);
    if (shutdown) {
      return;
    }
    runExecutable(executable.get());
  }
@Test
  public void shouldNotifyAppOnTerminate() throws Exception {
    // Given:
    final Capture<Runnable> captureShutdownHandler = newCapture();
    shutdownHandler.execute(capture(captureShutdownHandler));
    expectLastCall();
    precondition.notifyTerminated();
    expectLastCall();
    replay(shutdownHandler, precondition);
    main.tryStartApp();
    final Runnable handler = captureShutdownHandler.getValue();

    // When:
    handler.run();

    // Then:
    verify(precondition);
  }