nextIntBetween method
Generates a non-negative random integer uniformly distributed in the range
from min
, inclusive, to max
, exclusive.
Implementation
int nextIntBetween(int min, int max) {
final val = nextInt(max - min);
return min + val;
}