NumberUtil { public static int getRandomInt(int min, int max) { return RANDOM.nextInt(max) % (max - min + 1) + min; }  static int limitInt(int value, int min, int max); static long limitLong(long value, long min, long max); static int getRandomInt(int min, int max); static long getRandomLong(long bound); static float getRandomFloat(float bound, int scale); static float getRandomFloat(float bound, int scale, int roundingMode); static double getRandomDouble(double bound, int scale); static double getRandomDouble(double bound, int scale, int roundingMode); static double getDouble(double d, int scale); static double getDouble(double d, int scale, int roundingMode);  }
@Test public void testGetRandomInt() { int min = 10; int max = 100; int num = NumberUtil.getRandomInt(min, max); assertTrue(num > min); assertTrue(num <= max); }