public boolean equals(Object o) {
    if (o == this) {
      return true;
    }

    if (!(o instanceof ObjectIntHashMap)) {
      return false;
    }
    ObjectIntHashMap m = (ObjectIntHashMap) o;
    if (m.size() != size()) {
      return false;
    }

    try {
      for (final Entry e : entrySet()) {
        Object key = e.getKey();
        int value = e.getValue();
        if (!(m.containsKey(key))) {
          return false;
        } else if (!(value == m.get(key))) {
          return false;
        }
      }
    } catch (ClassCastException unused) {
      return false;
    } catch (NullPointerException unused) {
      return false;
    }

    return true;
  }
Compares the specified object with this map for equality. Returns <tt>true</tt> if the given
object is also a map and the two maps represent the same mappings. More formally, two maps
<tt>m1</tt> and <tt>m2</tt> represent the same mappings if
<tt>m1.entrySet().equals(m2.entrySet())</tt>. This ensures that the <tt>equals</tt> method
works properly across different implementations of the <tt>Map</tt> interface.

<p>
This implementation first checks if the specified object is this map; if so it returns
<tt>true</tt>. Then, it checks if the specified object is a map whose size is identical to the
size of this map; if not, it returns <tt>false</tt>. If so, it iterates over this map's
<tt>entrySet</tt> collection, and checks that the specified map contains each mapping that this
map contains. If the specified map fails to contain such a mapping, <tt>false</tt> is returned.
If the iteration completes, <tt>true</tt> is returned.

@param o object to be compared for equality with this map
@return <tt>true</tt> if the specified object is equal to this map
geode-core/src/main/java/org/apache/geode/cache/query/internal/ObjectIntHashMap.java