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();
      }
    }
  }
iterates through the index storage structure and compares size with the test list
geode-core/src/integrationTest/java/org/apache/geode/cache/query/internal/index/MapIndexStoreJUnitTest.java