title: How to convert Integer[] to int[] array in Java?
body: <p>Is there a fancy way to cast an Integer array to an int array?
  (I don't want to iterate over each element; I'm looking for an elegant and quick way to write it) </p>
  
  <p>The other way around I'm using </p>
  
  <p><code>scaleTests.add(Arrays.stream(data).boxed().toArray(Double[]::new));</code></p>
  
  <p>I'm looking for an one-liner but wasn't able to find something.</p>
  
  <p>The goal is to:</p>
  
  <pre><code>int[] valuesPrimitives = &lt;somehow cast&gt; Integer[] valuesWrapper
  </code></pre>