public Collection<Group> getGroups(User user) {
        return getGroups(XMPPServer.getInstance().createJID(user.getUsername(), null, true));
    }
Returns an iterator for all groups that the User is a member of.

@param user the user.
@return all groups the user belongs to.
xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java