code: public void permutate(int[] x) {
          for (int i = 0; i < x.length; i++) {
              int j = i + nextInt(x.length - i);
              Math.swap(x, i, j);
          }
      }
docs: Generates a permutation of given array.