code: public static int[] shuffleIndices (int length, RandomGenerator randomGenerator) {
          // Initialize indices:
          final int[] indices = IntStream.range(0, length).toArray();
  
          // Shuffle the array:
          MathArrays.shuffle(indices, randomGenerator);
  
          // Done return shuffled indices:
          return indices;
      }
docs: Consumes the length of an array and returns its shuffled indices.
  
  @param length The length of the arrays of which indices to be shuffled.
  @param randomGenerator Random number generator.
  @return Shuffled indices.