@Override
    @NotNull
    public BTreeMutable getMutableCopy() {
        final BTreeMutable result = new BTreeMutable(this);
        result.addExpiredLoggable(rootLoggable);
        return result;
    }
@Test
    public void testPutAndDelete() {
        tm = new BTreeEmpty(log, createTestSplittingPolicy(), true, 1).getMutableCopy();

        for (int i = 0; i < 100; i++) {
            getTreeMutable().put(kv(i, "v" + i));
        }

        long rootAddress = saveTree();
        tm = new BTree(log, getTreeMutable().getBalancePolicy(), rootAddress, true, 1).getMutableCopy();

        checkTree(getTreeMutable(), 100).run();

        for (int i = 0; i < 100; i++) {
            getTreeMutable().put(kv(i, "v" + i));
        }
        Assert.assertEquals(1L, (long) tm.getExpiredLoggables().getSize());
        for (int i = 0; i < 100; i++) {
            final INode ln = kv(i, "v" + i);
            getTreeMutable().delete(ln.getKey(), ln.getValue());
        }

        Assert.assertEquals(0, tm.getSize());
        assertMatchesIterator(tm, Collections.emptyList());

        rootAddress = saveTree();

        reopen();

        t = new BTree(log, rootAddress, true, 1);
        assertMatchesIterator(tm, Collections.emptyList());
    }