public int[] findAvailablePids(final int number) throws TimeoutException {
    Set<Integer> pids = new HashSet<>();
    while (pids.size() < number) {
      int pid = new AvailablePid().findAvailablePid();
      pids.add(pid);
    }
    return Arrays.stream(pids.toArray(new Integer[0])).mapToInt(Integer::intValue).toArray();
  }
Returns specified number of unique, randomly unused pids between {@code lowerBound} (inclusive)
and {@code upperBound} (inclusive).
geode-junit/src/main/java/org/apache/geode/internal/process/lang/AvailablePid.java