How to convert Integer[] to int[] array in Java?
If you can consider using Apache commons ArrayUtils then there is a simple toPrimitive API:
public static double[] toPrimitive(Double[] array, double valueForNull)
Converts an array of object Doubles to primitives handling null.
This method returns null for a null input array.
You can use Stream APIs of Java 8
int[] intArray = Arrays.stream(array).mapToInt(Integer::intValue).toArray();