question: private void validateIndexStorage ( ) { CloseableIterator < IndexStoreEntry > iterator = null ; try { ArrayList structureList = new ArrayList ( ) ; iterator = indexDataStructure . iterator ( null ) ; while ( iterator . hasNext ( ) ) { IndexStoreEntry ie = iterator . next ( ) ; if ( entriesContains ( ie ) ) { structureList . add ( ie ) ; } else { fail ( "IndexDataStructure returned an IndexEntry that should not be present:" + ie ) ; } } assertEquals ( "Expected Number of entries did not match" , entries . size ( ) , structureList . size ( ) ) ; } finally { if ( iterator != null ) { iterator . close ( ) ; } } }
target:  iterates through the index storage structure and compares size with the test list