@Override
    public Collection<String> getGroupNames(JID user)
    {
        return getGroupProviders().parallelStream()
            .map(groupProvider -> groupProvider.getGroupNames(user))
            .flatMap(Collection::stream)
            .collect(Collectors.toSet());
    }
Returns the Collection of group names that an entity belongs to.

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

@param user the (bare) JID of the entity.
@return the Collection of group names that the user belongs to.
xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupMultiProvider.java