Add a test for group by reference vector