title: Differences of Java 16's Stream.toList() and Stream.collect(Collectors.toList())?
body: <p><a href="https://bugs.openjdk.java.net/browse/JDK-8180352" rel="noreferrer">JDK 16 now includes a <code>toList()</code> method directly on <code>Stream</code> instances</a>. In previous Java versions, you always had to use the <code>collect</code> method and provide a <code>Collector</code> instance.</p>
  <p>The new method is obviously fewer characters to type. Are both methods interchangeable or are there subtle differences one should be aware of?</p>
  <pre><code>var newList = someCollection.stream()
      .map(x -&gt; mapX(x))
      .filter(x -&gt; filterX(x))
      .toList();
  
  // vs.
  
  var oldList = someCollection.stream()
      .map(x -&gt; mapX(x))
      .filter(x -&gt; filterX(x))
      .collect(Collectors.toList());
  </code></pre>
  <p>(This question is similar to <a href="https://stackoverflow.com/questions/65741773/would-stream-tolist-perform-better-than-collectors-tolist">Would Stream.toList() perform better than Collectors.toList()</a>, but focused on behavior and not (only) on performance.)</p>