public List<RosterGroup> getGroups() {
        List<RosterGroup> results = new ArrayList<>();
        // Loop through all roster groups and find the ones that contain this
        // entry. This algorithm should be fine
        for (RosterGroup group : roster.getGroups()) {
            if (group.contains(this)) {
                results.add(group);
            }
        }
        return results;
    }
public List < RosterGroup > getGroups ( ) { List < RosterGroup > results = new ArrayList < > ( ) ; for ( RosterGroup group : roster . getGroups ( ) ) { if ( group . contains ( this ) ) { results . add ( group ) ; } } return results ; }
Returns an copied list of the roster groups that this entry belongs to.

@return an iterator for the groups this entry belongs to.