static int getRandomInt ( int min , int max , Random random ) { // Use random.nextInt as it guarantees a uniform distribution int maxForRandom = max - min + 1 ; return random . nextInt ( maxForRandom ) + min ; }
Generates a random number within the given bounds .