added unit test for  iterator pattern