public static void initializeUniquePortRange(int jvmIndex) {
    if (jvmIndex < 0) {
      throw new RuntimeException("Range number cannot be negative.");
    }

    if (jvmIndex == 0) {
      nextCandidatePort.set(AVAILABLE_PORTS_LOWER_BOUND);
      return;
    }

    // Generate starting points such that JVM 0 starts at the lower bound of the total port
    // range, JVM 1 starts halfway through, JVM 2 starts 1/4 of the way through, then further
    // ranges are 3/4, 1/8, 3/8, 5/8, 7/8, 1/16, etc.
    int availableRange = AVAILABLE_PORTS_UPPER_BOUND - AVAILABLE_PORTS_LOWER_BOUND;
    int numChunks = Integer.highestOneBit(jvmIndex) << 1;
    int chunkNumber = 2 * (jvmIndex - Integer.highestOneBit(jvmIndex)) + 1;
    int firstCandidatePort = AVAILABLE_PORTS_LOWER_BOUND + chunkNumber * availableRange / numChunks;

    nextCandidatePort.set(firstCandidatePort);
  }
Assign this JVM's next candidate port based on the given index. If each JVM in the same test
calls this function with a small, distinct number, the algorithm:
<ul>
<li>Separates the JVMs' next candidate ports reasonably well</li>
<li>Allows adding JVMs without needing to know the total number of JVMs ahead of time</li>
</ul>

@param jvmIndex a small number different from that of any other JVM running in this test
geode-junit/src/main/java/org/apache/geode/internal/AvailablePortHelper.java