@Test
public void testLoadAll() throws Exception {

    Map<String, Table> tables = new HashMap<String, Table>();
    for (int i = 0; i < 10; i++) {
        Table table = new Table();
        table.setName(UUID.randomUUID().toString());
        table.setTtl(20);
        tables.put(table.getName(), table);
        elasticsearchServer.getClient().prepareIndex()
                .setIndex(TABLE_META_INDEX)
                .setType(TABLE_META_TYPE)
                .setConsistencyLevel(WriteConsistencyLevel.ALL)
                .setSource(mapper.writeValueAsString(table))
                .setId(table.getName())
                .setRefresh(true)
                .execute()
                .actionGet();
    }
    Set<String> names = ImmutableSet.copyOf(Iterables.limit(tables.keySet(), 5));
    Map<String, Table> responseTables = tableMapStore.loadAll(names);
    assertEquals(names.size(), responseTables.size());
    for (String name : names) {
        compareTables(tables.get(name), responseTables.get(name));
    }
}