code: private static void swap(long[] values, int[] index, int i, int j) {
          if (i != j) {
              swap(values, i, j);
              swap(index, i, j);
              numSwaps ++;
          }
      }
docs: Swaps the elements at positions i and j in both the values and index array, which must be the same length.
  @param values An array of values.
  @param index An array of indices.
  @param i The position of the first element to swap.
  @param j The position of the second element to swap.