code: public synchronized ProcessAdapter restart() {
      if (isRunning()) {
        stopAndWait();
      }
  
      Assert.state(isNotRunning(), "Process [%d] failed to stop", safeGetId());
  
      return execute(this, getProcessContext());
    }
docs: Restarts this {@link Process} by first attempting to stop this {@link Process} if running
  and then running this {@link Process} by executing this {@link Process Process's}
  {@link #getCommandLine() command-line} in the given {@link #getDirectory() directory}.
  
  @return a reference to this newly started and running {@link ProcessAdapter}.
  @throws IllegalStateException if this {@link Process} cannot be stopped and restarted.
  @see #execute(ProcessAdapter, ProcessContext)
  @see #isNotRunning()
  @see #isRunning()
  @see #stopAndWait()