code: public List<T> generateRandomCandidate(Random rng)
      {
          List<T> candidate = new ArrayList<T>(elements);
          Collections.shuffle(candidate, rng);
          return candidate;
      }
docs: Generates a random permutation from the configured elements.
  @param rng A source of randomness used to generate the random
  permutation.
  @return A random permutation.