I have two collections of the same object, Collection oldSet and Collection newSet. The required logic is as follow:
Collection oldSet
Collection newSet
public static boolean doCollectionsContainSameElements( Collection c1, Collection c2){ if (c1 == null || c2 == null) { return false; } else if (c1.size() != c2.size()) { return false; } else { return c1.containsAll(c2) && c2.containsAll(c1); } }