removing unused code in loops in Collection test class