Helper { public static int[] constructCodePointArrayFomMinMaxValues(int minCodePoint, int maxCodePoint) { if (minCodePoint >= maxCodePoint) throw new IllegalArgumentException("minCodePoint must be less than maxCodePoint"); if (minCodePoint < GlobalConstants.MIN_ALLOWED_CODE_POINT || maxCodePoint > GlobalConstants.MAX_ALLOWED_CODE_POINT) throw new IllegalArgumentException("Code points must be between " + GlobalConstants.MIN_ALLOWED_CODE_POINT + " and " + GlobalConstants.MAX_ALLOWED_CODE_POINT); int codePointCount = maxCodePoint - minCodePoint + 1; int[] allCodePoints = new int[codePointCount]; for (int i = 0; i < codePointCount; i++) { allCodePoints[i] = minCodePoint + i; } return allCodePoints; }  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 testConstructCodePointArrayFomMinMaxValuesOneToTen() throws Exception { int min = 1; int max = 10; int[] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; assertTrue(Arrays.equals(Helper.constructCodePointArrayFomMinMaxValues(min, max), array)); }
@Test(expected = IllegalArgumentException.class) public void testConstructCodePointArrayFomMinMaxValuesNegativeMinThrowsException() throws Exception { int min = -1; int max = 10; Helper.constructCodePointArrayFomMinMaxValues(min, max); }
@Test(expected = IllegalArgumentException.class) public void testConstructCodePointArrayFomMinMaxValuesMaxLessThanMin() throws Exception { int min = -1; int max = 10; assertNotNull(Helper.constructCodePointArrayFomMinMaxValues(10, -1)); }