Helper { public static void validateCodePointValues(int[] codePoints) { for (int c : codePoints) { if (c < GlobalConstants.MIN_ALLOWED_CODE_POINT || c > GlobalConstants.MAX_ALLOWED_CODE_POINT) throw new IllegalArgumentException("Code point must be between " + GlobalConstants.MIN_ALLOWED_CODE_POINT + " and " + GlobalConstants.MAX_ALLOWED_CODE_POINT); } }  static void shuffleIntArray(int[] arr); static int[] convertIntegerListToIntArray(List<Integer> listOfInts); static Point rotatePoint(Point reference, Point toRotate, int degrees); static void validateCodePointValues(int[] codePoints); static int[] constructCodePointArrayFomMinMaxValues(int minCodePoint, int maxCodePoint); static int convertStringToIntOrDefault(String str, int defaultValue); static int[] convertCodePointsToSortedIntArrayNoDuplicates(String line, String range);  }
@Test public void testValidateCodePointValues() throws Exception { int[] cpv = {-1, 2, 3}; try { Helper.validateCodePointValues(cpv); Helper.validateCodePointValues(new int[]{0, GlobalConstants.MAX_ALLOWED_CODE_POINT + 1}); } catch (IllegalArgumentException e) { assertEquals(e.getMessage(), "Code point must be between " + GlobalConstants.MIN_ALLOWED_CODE_POINT + " and " + GlobalConstants.MAX_ALLOWED_CODE_POINT); } }