code: public void await() throws ProcessHandlerException {
      try {
        if (message != null
            && timeoutSeconds != 0
            && !waitLatch.await(timeoutSeconds, TimeUnit.SECONDS)) {
          throw new ProcessHandlerException(
              "Timed out waiting for the success message: '" + message + "'");
        }
        if (exited) {
          throw new ProcessHandlerException("Process exited before success message");
        }
      } catch (InterruptedException e) {
        throw new ProcessHandlerException(e);
      } finally {
        waitLatch.countDown();
      }
    }
docs: Blocks the executing thread until the specified message is seen through {@link
  #onOutputLine(String)}. If the message is not seen within the specified timeout, {@link
  ProcessHandlerException} will be thrown.