random method

T random(
  1. Random random
)

Implementation

T random(Random random) => this[random.nextInt(length)];