private void shutdownAllProcesses() {
    LOG.info("Killing daemons using pid files");
    final List<String> pidFiles = new ArrayList<>(daemonPidFiles);
    for (String pidFile : pidFiles) {
      int pid = 0;
      try {
        pid = readPidFromFile(pidFile);
      } catch (IOException ex) {
        LOG.error("Could not read pid from file " + pidFile);
      }

      if (pid > 0) {
        LOG.info("Killing pid " + pid + " (" + pidFile + ")");
        killProcess(pid);
      }
    }
  }
Generates a list of random port numbers in the sorted order. A sorted order makes sense if we
ever want to refer to these servers by their index in the returned array, e.g. server #0, #1,
etc.
hbase-diagnostics/src/test/java/org/apache/hadoop/hbase/util/ProcessBasedLocalHBaseCluster.java