title: Collecting stream back into the same collection type
body: <p>Suppose I have a collection of the unknown type. What I want to do is stream it, do some stuff on the stream, and collect it back into the same collection type as my original collection. For instance:</p>
  
  <pre><code>Collection&lt;? extends Integer&gt; getBigger(Collection&lt;? extends Integer&gt; col, int value) {
      return col.stream().filter(v -&gt; v &gt; value).collect(????);
  } 
  </code></pre>
  
  <p>The idea of this incomplete code example is to return a <code>List</code> if <code>col</code> is of <code>List</code> class (or any subclass of it), a <code>Set</code> if <code>col</code> is of <code>Set</code> class, etc... The method name and actual operations on the stream here are not important, I've specified them just to illustrate my question.
  So, is it possible?  </p>