private static void initProvider(final Class<? extends GroupProvider> clazz) {
        if (provider == null || !clazz.equals(provider.getClass())) {
            try {
                provider = clazz.getDeclaredConstructor().newInstance();
            } catch (Exception e) {
                Log.error("Error loading group provider: {}", clazz.getName(), e);
                provider = new DefaultGroupProvider();
            }
        }
    }
Returns a singleton instance of GroupManager.

@return a GroupManager instance.
xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java