[Bug fix] Edit to testGrouping function, added if clause to deal with non test objects