code: @Override
    public void onOutputLine(String line) {
      if (waitLatch.getCount() > 0 && message != null && line.matches(message)) {
        waitLatch.countDown();
      }
    }
docs: Monitors the output of the process to check whether the wait condition is satisfied.