@Override
    public V replace(K key, V value) {
        V priorValue = super.replace(key, value);
        if (priorValue != null) {
            syncGroups(value, VALUES, ADD);
            syncGroups(priorValue, VALUES, REMOVE);
        }
        return priorValue;
    }
This method is called from several of the mutators to keep
the group set in sync with the keys in the map. 

@param item The item to be added or removed if it is in the group set
@param keyOrValue True for keys, false for values
@param addOrRemove True to add, false to remove
@return true if the given item is a group
xmppserver/src/main/java/org/jivesoftware/openfire/group/ConcurrentGroupMap.java