What would be a good way to compare two Stream instances in Java 8 and find out whether they have the same elements, specifically for purposes of unit testing?<
Stream
Using the elementsEqual method in the Guava library:
Iterators.elementsEqual(s1.iterator(), s2.iterator())