Having a custom assertIteratorEquals would help to clean this code up.