Refactored to remove unused loop variable

Refactored to remove unused loop variable from the test case.