@Test
public void testIndex() throws Exception {

    // Create a temp dir...
    final File tmpDir = Files.createTempDir();
    tmpDir.deleteOnExit();
    // Copy the .Index.db file to the temp dir...
    File sampleFile = new File(getClass().getResource(INDEX_FILE).getFile());
    File tmpSampleFile = new File(tmpDir, sampleFile.getName());
    Files.copy(sampleFile, tmpSampleFile);
    fileSystem.getConf().set("hadoop.sstable.split.mb", "1");
    SSTableIndexIndexer indexer = new SSTableIndexIndexer(fileSystem.getConf());
    indexer.index(new Path(tmpDir.getAbsolutePath(), sampleFile.getName()));
    indexer.complete();
    SSTableIndexIndex index =
            SSTableIndexIndex.readIndex(fileSystem, new Path(tmpDir.getAbsolutePath(), sampleFile.getName()));
    assertNotNull(index);
    assertEquals(1, index.getOffsets().size());
    assertEquals(0, index.getOffsets().get(0).getStart());
    assertEquals(18, index.getOffsets().get(0).getEnd());
}