Add tests for Stats#sort_by