@Override
    public Collection<String> getSharedGroupNames(JID user)
    {
        return getGroupProviders().parallelStream()
            .filter(GroupProvider::isSharingSupported)
            .map(groupProvider -> groupProvider.getSharedGroupNames(user))
            .flatMap(Collection::stream)
            .collect(Collectors.toSet());
    }
Returns an unmodifiable Collection of all shared groups in the system for a given user.

Implementations should use the bare JID representation of the JID passed as an argument to this method.

@param user The bare JID for the user (node@domain)
@return unmodifiable Collection of all shared groups in the system for a given user.
xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupMultiProvider.java