Add getCachingIterator method to collection.