I\'m trying to convert an ArrayList containing Integer objects to primitive int[] with the following piece of code, but it is throwing compile time error. Is it possible to
Java 8:
int[] intArr = Arrays.stream(integerList).mapToInt(i->i).toArray();