Entry removeMapping(Object o) {
    if (!(o instanceof Entry)) {
      return null;
    }

    Entry entry = (Entry) o;
    Object key = entry.getKey();
    int hash = (key == null) ? 0 : hash(hashingStrategy.hashCode(key));
    int i = indexFor(hash, table.length);
    Entry prev = table[i];
    Entry e = prev;

    while (e != null) {
      Entry next = e.next;
      if (e.hash == hash && e.equals(entry)) {
        modCount++;
        size--;
        if (prev == e) {
          table[i] = next;
        } else {
          prev.next = next;
        }
        e.recordRemoval(this);
        return e;
      }
      prev = e;
      e = next;
    }

    return e;
  }
Special version of remove for EntrySet.
geode-core/src/main/java/org/apache/geode/cache/query/internal/ObjectIntHashMap.java