title: Can you split a stream into two streams?
body: <p>I have a data set represented by a Java 8 stream:</p>
  
  <pre><code>Stream&lt;T&gt; stream = ...;
  </code></pre>
  
  <p>I can see how to filter it to get a random subset - for example</p>
  
  <pre><code>Random r = new Random();
  PrimitiveIterator.OfInt coin = r.ints(0, 2).iterator();   
  Stream&lt;T&gt; heads = stream.filter((x) -&gt; (coin.nextInt() == 0));
  </code></pre>
  
  <p>I can also see how I could reduce this stream to get, for example, two lists representing two random halves of the data set, and then turn those back into streams.
  But, is there a direct way to generate two streams from the initial one? Something like</p>
  
  <pre><code>(heads, tails) = stream.[some kind of split based on filter]
  </code></pre>
  
  <p>Thanks for any insight.</p>