Implementation and tests of task2
Merge branch 't2-find-groups'