public int getRandomInt ( ) { Integer newInt = null ; do { newInt = randomGenerator . nextInt ( ) ; } while ( this . previousRandomInts . contains ( newInt ) ) ; this . previousRandomInts . add ( newInt ) ; return newInt . intValue ( ) ; }
Generates a random integer that is unique with respect to the document . Will not return a number between - 1 and - 5 because some values in that range are invalid .