public MutableTree<K> beginWrite() {
        return new MutableTree<>(this);
    }
@Test
    public void testAddAll() {
        final Persistent23Tree<Integer> source = new Persistent23Tree<>();
        final int count = 1000;
        ArrayList<Integer> entries = new ArrayList<>(count);
        for (int i = 0; i < count; i++) {
            final Persistent23Tree.MutableTree<Integer> tree = source.beginWrite();
            tree.addAll(entries.iterator(), i);
            Assert.assertEquals(i, tree.size());
            int j = 0;
            for (Integer key : tree) {
                Assert.assertEquals(new Integer(j), key);
                j++;
            }
            tree.testConsistency();
            entries.add(i);
        }
    }