title: How to collect a stream into a CopyOnWriteArrayList
body: <p>I'm getting "Incompatible types, required: CopyOnWriteArrayList, found: Object" with the following. I'm using IntelliJ 2016.1.1. </p>
  
  <pre><code>CopyOnWriteArrayList&lt;Foo&gt; l = fields.stream()
                                      .distinct()
                                      .collect(toCollection(CopyOnWriteArrayList::new));
  </code></pre>