@Test
public void buildMerkleTree() {

    Partition partition = new Partition(42, 42);
    assertTrue(indexDao.getListById(303277865741324292L).isEmpty());
    assertNull(indexDao.getById(303277865741324292L, 1));
    IndexElt expected1 = new IndexElt.IndexEltBuilder()
            .id(303277865741324292L)
            .type(1)
            .partition(partition)
            .offset(0L)
            .length(128L)
            .metadata(ImmutableMap.of("key", "value"))
            .crc(42L)
            .build();
    indexDao.add(expected1);
    IndexElt expected2 = new IndexElt.IndexEltBuilder()
            .id(303277865741324292L)
            .type(2)
            .partition(partition)
            .offset(128L)
            .length(128L)
            .metadata(ImmutableMap.of("key", "value"))
            .crc(42L)
            .build();
    indexDao.add(expected2);
    IndexElt expected3 = new IndexElt.IndexEltBuilder()
            .id(303277865741324291L)
            .type(0)
            .partition(partition)
            .offset(0L)
            .length(128L)
            .metadata(ImmutableMap.of("key", "value"))
            .crc(42L)
            .build();
    indexDao.add(expected3);
    MerkleTree merkleTree = indexUtils.buildMerkleTree(partition);
    assertEquals(merkleTree.getLeafNodes().size(), 2);
    log.info("{}", merkleTree.getLeafNodes().get(1).getHash());
    assertEquals(merkleTree.getLeafNodes().get(1).getHash(), new byte[]{4, 53, 117, -100, -81, -64, 16, 4, 0, 0, 0, 1, 0, 0, 0, 2});
}