code: public boolean waitFor(long timeout, TimeUnit unit) {
      try {
        return getProcess().waitFor(timeout, unit);
      }
      catch (InterruptedException ignore) {
        Thread.currentThread().interrupt();
        return isNotRunning();
      }
    }
docs: Waits until the specified timeout for this {@link Process} to stop.
  
  This method handles the {@link InterruptedException} thrown by {@link Process#waitFor(long, TimeUnit)}
  by resetting the interrupt bit on the current (calling) {@link Thread}.
  
  @param timeout long value to indicate the number of units in the timeout.
  @param unit {@link TimeUnit} of the timeout (e.g. seconds).
  @return a boolean value indicating whether the {@link Process} stopped within the given timeout.
  @see java.lang.Process#waitFor(long, TimeUnit)
  @see #isNotRunning()