public Collection<Group> getSharedGroups() {
        Collection<Group> groups = new ArrayList<>(sharedGroups.size());
        for (String groupName : sharedGroups) {
            try {
                groups.add(GroupManager.getInstance().getGroup(groupName));
            }
            catch (GroupNotFoundException e) {
                // Do nothing
            }
        }
        return groups;
    }
Returns the shared groups for the item.

@return The shared groups this item belongs to.
xmppserver/src/main/java/org/jivesoftware/openfire/roster/RosterItem.java