title: JpaRepository behaves differently with Stream<T> and List<T> return types regarding duplicates?
body: <p>In a project, there is a large jpa query like</p>
  
  <pre><code>@Query( "select foo from FooEntity
      left join fetch foo.bars bars
      join fetch bars.baz "
        /** ca 10 more entities with join fetch and left join fetch" */
      "where" /** some conditions */
      "order by foo.id")
  Stream&lt;FooEntity&gt; getFoos()
  </code></pre>
  
  <p>Now I tried changing it to <code>List&lt;FooEntity&gt;</code> (as the client only called <code>collect(toList())</code>), but it breaks some tests, it contains duplicates. When using <code>Set&lt;FooEntity&gt;</code>, it behaves the same way as with <code>Stream&lt;FooEntity&gt;</code>.</p>
  
  <p>Without going into details about the large query, it is "ok", expected behaviour or may this indicate some bug in the query?</p>
  
  <p>I also looked at some questions like <a href="https://stackoverflow.com/questions/1560239/is-it-valid-for-hibernate-list-to-return-duplicates">Is it valid for Hibernate list() to return duplicates?</a>, but are there any differences between <code>Stream</code>, and <code>List</code>, which may be defined in some spec?</p>
  
  <p>The SQL generated by Hibernate is BTW the same for all return types</p>