title: How to convert a java.util.stream.Stream into an array?
body: <p>What would <code>streamToArray</code> need to do in the following code?</p>
  
  <pre><code>IntStream stream = IntStream.range(0, 3);
  int[] array = streamToArray(stream); // array = [0, 1, 2]
  </code></pre>