The list of methods to do Collection Equal are organized into topic(s).
boolean
areEqual(Collection collection1, Collection collection2) are Equal
if (collection1.size() != collection2.size())
return false;
Iterator iterator = collection1.iterator();
while (iterator.hasNext()) {
if (!collection2.contains(iterator.next()))
return false;
return true;
...
boolean
areEqual(Collection> collection1, Collection> collection2) are Equal
if (collection1 == null && collection2 == null)
return true;
if (collection1 == null || collection2 == null)
return false;
if (collection1.size() != collection2.size())
return false;
for (Object member : collection1) {
if (!collection2.contains(member))
...
boolean
content_equality(Collection A, Collection B) this can be an expensive operation, intended for testing not operating code
if (A == B)
return true;
if (A == null || B == null)
return false;
if (A.size() != B.size())
return false;
Set<N> elements = new HashSet<N>();
elements.addAll(A);
...