RandUtil { public static int nextInt() { return insecureRandom.nextInt(); } private  RandUtil(); static boolean nextBoolean(); static int nextInt(); static int nextInt(int lower, int upper); static long nextLong(long n); static long nextLong(long lower, long upper); static long nextLong(); static String nextAlphabetic(int characters); static String nextNumeric(int digits); static E nextItem(E[] array);  }
@Test @DisplayName("Test bounded integer generation") void nextInt_1() { for (int[] range : new int[][] { { -2, 10 }, { -1, 1 }, { 1, 100 }, { -100, -1 }, { 0, 1 } }) { int min = range[0]; int max = range[1]; for (int i = 0; i < 1000; i++) { int rand = RandUtil.nextInt(min, max); assertTrue(rand >= min); assertTrue(rand <= max); } } }