code: public static int destroyProcess(final Process process) throws InterruptedException {
          if (process == null)
              return 0;
          process.destroy();
          return process.waitFor();
      }
docs: Destroys the process if the process is not {@code null}.
  
  @param process the process to destroy, terminate
  
  @return 0 if the process was successfully destroyed