@Override public boolean equals(Object object){
  if (this == object) {
    return true;
  }
  if (object instanceof Set) {
    Set<?> s=(Set<?>)object;
    try {
      return size() == s.size() && containsAll(s);
    }
 catch (    NullPointerException ignored) {
      return false;
    }
catch (    ClassCastException ignored) {
      return false;
    }
  }
  return false;
}

@ Override public boolean equals ( Object object ) { if ( this == object ) { return true ; } if ( object instanceof Set ) { Set < ? > s = ( Set < ? > ) object ; try { return size ( ) == s . size ( ) && containsAll ( s ) ; } catch ( NullPointerException ignored ) { return false ; } catch ( ClassCastException ignored ) { return false ; } } return false ; }
compares the specified object to this set and returns true if they are equal . the object must be an instance of set and contain the same objects .
