code: public int[] permutate(int n) {
          int[] x = new int[n];
          for (int i = 0; i < n; i++) {
              x[i] = i;
          }
  
          permutate(x);
  
          return x;
      }
docs: Generates a permutation of 0, 1, 2, ..., n-1, which is useful for
  sampling without replacement.