title: Odd and even numbers with single filter?
body: <p>I have recently faced an interview question where I was required to filter out odd and even numbers from a <code>List</code>. The only catch was that <strong>I could not use 2 filters</strong> like the following:</p>
  <pre><code>List&lt;Integer&gt; nums = Arrays.asList(1,2,3,4,5);
          
  List&lt;Integer&gt; odd = nums.stream().filter(n -&gt; n%2 != 0).collect(Collectors.toList());
          
  List&lt;Integer&gt; even = nums.stream().filter(n -&gt; n%2 == 0).collect(Collectors.toList());
  </code></pre>
  <p>I said it was not possible since the final <code>collect</code> method can <strong>only return 1 single list.</strong></p>
  <p>What am I missing?</p>