Helper { public static int[] convertIntegerListToIntArray(List<Integer> listOfInts) { int[] arrayOfInts = new int[listOfInts.size()]; Iterator<Integer> iter = listOfInts.iterator(); for (int i = 0; i < arrayOfInts.length; i++) { arrayOfInts[i] = iter.next().intValue(); } return arrayOfInts; }  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 testConvertIntegerListToIntArray() throws Exception { int[] a = {1, 2, 3}; List<Integer> l = new ArrayList<>(); for (int temp : a) { l.add(new Integer(temp)); } assertArrayEquals(a, Helper.convertIntegerListToIntArray(l)); }