code: public static CommandLine buildKillCommandLine(String pid)
      {
          CommandLine command;
  
          if (SystemUtils.IS_OS_WINDOWS)
          {
              command = new CommandLine("taskkill")
                      .addArgument("/F")
                      .addArgument("/pid")
                      .addArgument(pid);
          }
          else
          {
              command = new CommandLine("kill").addArgument(pid);
          }
          
          return command;
      }
docs: Build an OS dependent command line to kill the process with the given PID.