void closeAndClearIndex() throws StoreException {
    index.close(false);
    // delete all index files
    File[] indexSegmentFiles = tempDir.listFiles(new FilenameFilter() {
      @Override
      public boolean accept(File dir, String name) {
        return name.endsWith(IndexSegment.INDEX_SEGMENT_FILE_NAME_SUFFIX) || name.endsWith(
            IndexSegment.BLOOM_FILE_NAME_SUFFIX);
      }
    });
    assertNotNull("Could not load index segment files", indexSegmentFiles);
    for (File indexSegmentFile : indexSegmentFiles) {
      assertTrue("Could not deleted index segment file", indexSegmentFile.delete());
    }
    logOrder.clear();
    referenceIndex.clear();
    allKeys.clear();
    liveKeys.clear();
    expiredKeys.clear();
  }
Closes the index and clears all the index files.
@throws StoreException
ambry-store/src/test/java/com/github/ambry/store/CuratedLogIndexState.java