Why doesn't Collectors.toList() work on primitive collections?
<p>(This is probably related to <a href="https://stackoverflow.com/a/30312177/160137">https://stackoverflow.com/a/30312177/160137</a>, but I'm afraid I still don't get it. So I'm asking my question this way, in the hope that it'll lead to an answer I can more easily understand.)</p>

<p>Normally when I have a Stream I can convert it to a collection using one of the static methods in the Collectors class:</p>

<pre><code>List&lt;String&gt; strings = Stream.of("this", "is", "a", "list", "of", "strings")
    .collect(Collectors.toList());
</code></pre>

<p>The similar process doesn't work on primitive streams, however, as others have noticed:</p>

<pre><code>IntStream.of(3, 1, 4, 1, 5, 9)
    .collect(Collectors.toList());  // doesn't compile
</code></pre>

<p>I can do this instead:</p>

<pre><code>IntStream.of(3, 1, 4, 1, 5, 9)
    .boxed()
    .collect(Collectors.toList());
</code></pre>

<p>or I can do this:</p>

<pre><code>IntStream.of(3, 1, 4, 1, 5, 9)
    .collect(ArrayList&lt;Integer&gt;::new, ArrayList::add, ArrayList::addAll);
</code></pre>

<p>The question is, why doesn't Collectors.toList() just do that for primitive streams? Is it that there's no way to specify the wrapped type? If so, why doesn't this work either:</p>

<pre><code>IntStream.of(3, 1, 4, 1, 5, 9)
    .collect(Collectors.toCollection(ArrayList&lt;Integer&gt;::new)); // nope
</code></pre>

<p>Any insight would be appreciated.</p>