int randomInt(int max)

Returns a random int from 0 to max - 1.

Source

int randomInt(int max) {
  return _random.nextInt(max);
}