code: public static void shuffle(Object[] a, int lo, int hi) {
      if (lo < 0 || lo > hi || hi >= a.length) {
        throw new IndexOutOfBoundsException("Illegal subarray range");
      }
      for (int i = lo; i <= hi; i++) {
        int r = i + uniform(hi - i + 1); // between i and hi
        Object temp = a[i];
        a[i] = a[r];
        a[r] = temp;
      }
    }
docs: Rearrange the elements of the subarray a[lo..hi] in random order.
  
  @param a the array to shuffle.
  @param hi the upper bound.
  @param lo the lower bound.