public int getGroupCount() {
            Integer count = getGroupCountFromCache();
        if (count == null) {
            synchronized(GROUP_COUNT_LOCK) {
                count = getGroupCountFromCache();
                if (count == null) {
                    count = provider.getGroupCount();
                    saveGroupCountInCache(count);
                }
            }
        }
        return count;
    }
Returns the total number of groups in the system.

@return the total number of groups.
xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java