Java Utililty Methods Set Compare

List of utility methods to do Set Compare

Description

The list of methods to do Set Compare are organized into topic(s).

Method

intcompareSet(Set set1, Set set2)
compare Set
int sameCount = 0;
for (Object o : set1) {
    if (set2.contains(o))
        sameCount++;
return sameCount;
SetcompareSets(Set resSet, Set initSet)
compare Sets
Set result = null;
if (initSet == null || initSet.isEmpty()) {
    if (resSet != null && !resSet.isEmpty()) {
        result = resSet;
} else if (resSet == null || resSet.isEmpty()) {
    result = Collections.EMPTY_SET;
} else {
...