@Override
    public Collection<String> getPublicSharedGroupNames()
    {
        return getGroupProviders().parallelStream()
            .filter(GroupProvider::isSharingSupported)
            .map(GroupProvider::getPublicSharedGroupNames)
            .flatMap(Collection::stream)
            .collect(Collectors.toSet());
    }
Returns an unmodifiable Collection of all public shared groups by each of the providers that support sharing.

@return unmodifiable Collection of all public shared groups in the system.
xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupMultiProvider.java