public Group getGroup(JID jid) throws GroupNotFoundException {
        JID groupJID = GroupJID.fromJID(jid);
        return (groupJID instanceof GroupJID) ? getGroup(((GroupJID)groupJID).getGroupName()) : null;
    }
Returns the corresponding group if the given JID represents a group. 

@param jid The JID for the group to retrieve
@return The group corresponding to the JID, or null if the JID does not represent a group
@throws GroupNotFoundException if the JID represents a group that does not exist
xmppserver/src/main/java/org/jivesoftware/openfire/group/GroupManager.java