Unit test for the Iterator behavioral design pattern.