code: private int partition(int left, int right) {
          int i = left;
          int j = right;
          byte[] pivot = ranges[(left + right) / 2];
          while (i <= j) {
              while (KeyUtils.compareKey(ranges[i], pivot) < 0) {
                  i++;
              }
              while (KeyUtils.compareKey(ranges[j], pivot) > 0) {
                  j--;
              }
  
              if (i <= j) {
                  swap(i, j);
                  i++;
                  j--;
              }
          }
          return i;
      }
docs: Partitions part of an array of ranges. <br />
  The part of the array between <b>left</b> and <b>right</b> will be partitioned around the value held at
  ranges[right-1].
  
  @param left
  The left bound of the array.
  @param right
  The right bound of the array.
  @return The index of the pivot after the partition has occured.