Warning: Undefined array key "HTTP_REFERER" in /home/u522501990/domains/makemeengr.com/public_html/wp-content/themes/generatepress/generatepress.theme#archive on line 43

Is there a way to check if two Collections contain the same elements, independent of order?

Apache commons-collections has CollectionUtils#isEqualCollection:

Returns true if the given Collections contain exactly the same elements with exactly the same cardinality.

That is, if the cardinality of e in a is equal to the cardinality of e in b, for each element e in a or b.

Which is, I think, exactly what you’re after.

Leave a Comment

techhipbettruvabetnorabahisbahis forumutaraftarium24edusedueduedusedusedueduseduedusedus