code: public static void destroy(String pid, long sleeptimeBeforeSigkill,
                               boolean isProcessGroup, boolean inBackground) {
      if(isProcessGroup) {
        destroyProcessGroup(pid, sleeptimeBeforeSigkill, inBackground);
      }
      else {
        //TODO: Destroy all the processes in the subtree in this case also.
        // For the time being, killing only the root process.
        destroyProcess(pid, sleeptimeBeforeSigkill, inBackground);
      }
    }
docs: Destroy the process-tree.
  @param pid process id of the root process of the subtree of processes
  to be killed
  @param sleeptimeBeforeSigkill The time to wait before sending SIGKILL
  after sending SIGTERM
  @param isProcessGroup pid is a process group leader or not
  @param inBackground Process is to be killed in the back ground with
  a separate thread