previous | start | next

## Not all `equals` Methods are Simple

- Two sets are equal if they have the same elements in some order

      public boolean equals(Object o)

      {

         if (o == this) return true;

         if (!(o instanceof Set)) return false;

         Collection c = (Collection) o;

         if (c.size() != size()) return false;

         return containsAll(c);

      }

previous | start | next