@Override
    public Collection<String> getVisibleGroupNames(String userGroup) {
        HashSet<String> groupNames;

        synchronized (sharedGroupMetaCache) {
            groupNames = getSharedGroupsForGroupFromCache(userGroup);
            if (groupNames != null) {
                return groupNames;
            }

            if (!hasSharedGroups()) {
                // When there are no shared groups in the database at all, don't bother looking up specific ones.
                return new HashSet<>();
            }

            groupNames = getVisibleGroupNames(userGroup, new HashSet<>());
            saveSharedGroupsForGroupInCache(userGroup, groupNames);
        }
        return groupNames;
    }
Checks if any shared groups exists. No distinction is made between the type of shared group: any group that is
shared (with anything other than 'nobody') qualifies.

@return true if at least one shared group exists, otherwise false.
xmppserver/src/main/java/org/jivesoftware/openfire/group/AbstractGroupProvider.java