public long getUsedMemory() {
        long used = 0;
        for (long[] block : blocks) {
            used += (block != null ? block.length : 0);
        }
        return used;
    }
@Test
    public void when_allocateFree_then_noLeak() {
        final long addr1 = allocate();
        final long addr2 = allocate();
        free(addr1);
        free(addr2);
        assertEquals(0, memMgr.getUsedMemory());
    }