public static Group resolveFrom(Object proxy) {
        Group result = null;
        try {
            GroupManager groupManger = GroupManager.getInstance();
            if (proxy instanceof JID) {
                result = groupManger.getGroup((JID)proxy);
            } else if (proxy instanceof String) {
                result = groupManger.getGroup((String)proxy);
            } else if (proxy instanceof Group) {
                result = (Group) proxy;
            }
        } catch (GroupNotFoundException gnfe) {
            // ignore
        }
        return result;
    }
Attempt to resolve the given object into a Group.

@param proxy Presumably a Group, a Group name, or a JID that represents a Group
@return The corresponding group, or null if the proxy cannot be resolved as a group
xmppserver/src/main/java/org/jivesoftware/openfire/group/Group.java