getAllGroups method