List of utility methods to do Set Compare
int | compareSet(Set set1, Set set2) compare Set int sameCount = 0; for (Object o : set1) { if (set2.contains(o)) sameCount++; return sameCount; |
Set | compareSets(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 { ... |