@Test
public void testLoad() throws Exception {

    String filename = null;
    String[] argsRaw = {"zookeeper", "table"};
    Args args = new StatArgs(argsRaw);
    Load load = new Load(new LevelClass(TableName.class), args);
    LoadIO loadIO = createLoadIO(load);
    try {
        assertTrue(loadIO.showSavedFiles(args).startsWith(LoadIO.NO_SAVED_FILE));
        filename = loadIO.filename(args);
        loadIO.save(args);
        assertEquals(1, loadIO.savedFileNameList(args).size());
        List<String> strings = Files.readAllLines(Paths.get(filename), Charset.defaultCharset());
        for (String string : strings) {
            System.out.println(string);
        }
        assertFalse(loadIO.showSavedFiles(args).startsWith(LoadIO.NO_SAVED_FILE));
        loadIO.load(args, "0");
        assertEquals(filename, loadIO.getSavedFileName("0"));
        load.toggleDiffFromStart();
        assertTrue(load.isDiffFromStart());
        assertEquals(2, load.getLoadMap().size());
        assertEquals(2L, ((LoadRecord) (load.getLoadMapPrev().values().toArray()[0])).get(LoadEntry.Reads));
        assertEquals(1L, ((LoadRecord) (load.getLoadMapPrev().values().toArray()[1])).get(LoadEntry.Reads));
    } finally {
        if (filename != null) Files.delete(Paths.get(filename));
    }
}