Comparing two collections using Stream - anyMatch
<p>I want to compare if any of the objects in a <code>list2</code> is present in a <code>list1</code>.</p>

<p>I could iterate over both lists and compare all elements using <code>.contains()</code> but I am wondering if there is not a more efficient way. I found <a href="https://stackoverflow.com/questions/22557042/check-if-a-collection-contains-an-object-comparing-by-reference">this</a> and I am trying to implement the suggested method: </p>

<pre><code>List&lt;Item&gt; list1;
List&lt;Item&gt; list2;

boolean anyMatch = list1.stream().anyMatch(x -&gt; x.equals(list2.stream()));
System.out.println(anyMatch);
</code></pre>

<p>When I do this I constantly get <code>false</code>, even when I'd expect a <code>true</code>. How come?</p>