@Override
    public void clear() {
        final Map<K,V> originalMap = new HashMap<>(this); // copy to be used by event handling.
        super.clear();

        // Create a copy of all to-be-deleted string values (to be sent to event listeners).
        final Map<String, String> map = originalMap.entrySet().stream()
            .filter(entry -> entry.getValue() instanceof String && entry.getKey() instanceof String)
            .collect(Collectors.toMap(entry -> (String)entry.getKey(), entry -> (String)entry.getValue()));

        deleteAllProperties(map);
    }
Custom method to put properties into the map, optionally without
triggering persistence. This is used when the map is being 
initially loaded from the database.

@param key The property name
@param value The property value
@param persist True if the changes should be persisted to the database
@return The original value or null if the property did not exist
xmppserver/src/main/java/org/jivesoftware/openfire/group/DefaultGroupPropertyMap.java