title: How specialized are the Stream implementations returned by the standard collections?
body: <p><a href="http://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html"><code>Stream</code></a> is an interface so whenever one gets hold of a <code>Stream</code> object there are lots of implementation specific details hidden.</p>
  
  <p>For example, take the following code:</p>
  
  <pre><code>List&lt;String&gt; list = new ArrayList&lt;&gt;();
  ...
  int size = list.stream()
                 .count();
  </code></pre>
  
  <p>Does it run in constant or linear time? Or this:</p>
  
  <pre><code>Set&lt;String&gt; set = new TreeSet&lt;&gt;();
  ...
  set.stream()
     .sorted()
     .forEach(System.out::println);
  </code></pre>
  
  <p>Would that be O(n) or O(n log n)?</p>
  
  <p>In general, how specialized are the streams implementations returned by the standard collections?</p>