test for grouping by number