pickRandom<T> static method

T pickRandom<T>(
  1. List<T> elements
)

Implementation

static T pickRandom<T>(List<T> elements) {
  return elements[rng.nextInt(elements.length)];
}