public static <T>boolean areSetsIdentical(final Set<T> set1,final Set<T> set2){
  if (set1 == set2)   return true;
  if (CollectionUtil.size(set1) != CollectionUtil.size(set2))   return false;
  if (CollectionUtil.isEmpty(set1))   return true;
  for (  final T t : set1)   if (!set2.contains(t))   return false;
  return true;
}

public static < T > boolean areSetsIdentical ( final Set < T > set1 , final Set < T > set2 ) { if ( set1 == set2 ) return true ; if ( CollectionUtil . size ( set1 ) != CollectionUtil . size ( set2 ) ) return false ; if ( CollectionUtil . isEmpty ( set1 ) ) return true ; for ( final T t : set1 ) if ( ! set2 . contains ( t ) ) return false ; return true ; }
returns true iff all of the items on each set exist on the other set .
