@Override
    GroupProvider getGroupProvider(String groupName)
    {
        GroupProvider nonReadOnly = null;
        for (final GroupProvider provider : getGroupProviders()) {
            try {
                provider.getGroup(groupName);
                return provider;
            } catch (GroupNotFoundException ex) {
                Log.debug( "Group {} not found in GroupProvider {}", groupName, provider.getClass().getName() );

                if (nonReadOnly == null && !provider.isReadOnly()) {
                    nonReadOnly = provider;
                }
            }
        }

        // Group does not exist. Return a provider suitable for creating groups.
        if (nonReadOnly == null) {
            throw new UnsupportedOperationException();
        }

        return nonReadOnly;
    }
Returns the first provider that contains the group, or the first provider that is not read-only when the group
does not exist in any provider.

@param groupName the name of the group (cannot be null or empty).
@return The group provider (never null)
@throws UnsupportedOperationException When the group is not found and no provider can be used to create the group.
xmppserver/src/main/java/org/jivesoftware/openfire/group/HybridGroupProvider.java