@Override
    public Collection<String> getGroupNames(JID user)
    {
        return data.values().stream()
            .filter(group -> group.isUser(user))
            .map(Group::getName)
            .collect(Collectors.toSet());
    }
A very basic implementation of a GroupProvider, that retains data in-memory.

@author Guus der Kinderen, guus@goodbytes.nl
xmppserver/src/test/java/org/jivesoftware/openfire/group/TestGroupProvider.java