code: public static boolean kill(int processId) {
      String killCommand = String.format("%s %d",
        (SystemUtils.isWindows() ? WINDOWS_KILL_COMMAND : UNIX_KILL_COMMAND), processId);
  
      try {
        Process killProcess = Runtime.getRuntime().exec(killCommand);
        return killProcess.waitFor(KILL_WAIT_TIMEOUT, KILL_WAIT_TIME_UNIT);
      }
      catch (Throwable ignore) {
        return false;
      }
    }
docs: Kills the Operating System (OS) process identified by the process ID (PID).
  
  @param processId ID of the process to kill.
  @return a boolean value indicating whether the process identified by the process ID (ID)
  was successfully terminated.
  @see Runtime#exec(String)