Refactor group by test to new model.