title: Java Stream Collectors.toList() wont compile
body: <p>Can any one explain why the below code will not compile but the second one does?</p>
  
  <p><strong>Do not compile</strong></p>
  
  <pre><code>private void doNotCompile() {
  
      List&lt;Integer&gt; out;
      out = IntStream
              .range(1, 10)
              .filter(e -&gt; e % 2 == 0)
              .map(e -&gt; Integer.valueOf(2 * e))
              .collect(Collectors.toList());
  
      System.out.println(out);
  }
  </code></pre>
  
  <p>Compilation errors on the <em>collect</em> line</p>
  
  <ul>
  <li>The method collect(Supplier, ObjIntConsumer, BiConsumer) in the type IntStream is not applicable for the arguments (Collector>)</li>
  <li>Type mismatch: cannot convert from Collector> to Supplier</li>
  </ul>
  
  <p><strong>Compiles</strong></p>
  
  <pre><code>private void compiles() {
      List&lt;Integer&gt; in;
  
      in = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9);
      List&lt;Integer&gt; out;
      out = in.stream()
              .filter(e -&gt; e % 2 == 0)
              .map(e -&gt; 2 * e)
              .collect(Collectors.toList());
  
      System.out.println(out);
  }
  </code></pre>