private void basicRemoveMapping(Object key, RegionEntry entry, boolean updateReverseMap)
      throws IMQException {
    // after removal, trim the ArrayList to prevent
    // too much extra space.
    // Ideally we would only trim if there is excessive
    // space, but there is no way to ask an ArrayList what
    // it's current capacity is..so we trim after every
    // removal
    try {
      Object newKey = TypeUtils.indexKeyFor(key);
      removeFromEntriesSet(newKey, entry, updateReverseMap);
    } catch (TypeMismatchException ex) {
      throw new IMQException("Could not add object of type " + key.getClass().getName(), ex);
    }
  }
Remove an index entry for a RegionEntry when invalidate/destroy is called OR new index key is
inserted for the RegionEntry. In case of update only forward map is cleared of old key and NO
update is performed on reverse map as that has already been done during
{@link HashIndex#basicAddMapping(Object, RegionEntry)}.

@param key - Index key.
@param entry RegionEntry for which is being updated by user.
@param updateReverseMap true only when RegionEntry is invalidated/destroyed.
geode-core/src/main/java/org/apache/geode/cache/query/internal/index/HashIndex.java