Add getGroups method