@Test public void tailIterationTest() { Random random = new Random(239786); Persistent23Tree.MutableTree<Integer> tree = new Persistent23Tree<Integer>().beginWrite(); int[] p = genPermutation(random); TreeSet<Integer> added = new TreeSet<>(); for (int i = 0; i < ENTRIES_TO_ADD; i++) { int size = tree.size(); Assert.assertEquals(i, size); if ((size & 1023) == 0 || size < 100) { if (i > 0) { checkTailIteration(tree, added, added.first()); checkTailIteration(tree, added, added.first() - 1); checkTailIteration(tree, added, added.last()); checkTailIteration(tree, added, added.last() + 1); } checkTailIteration(tree, added, Integer.MAX_VALUE); checkTailIteration(tree, added, Integer.MIN_VALUE); for (int j = 0; j < 10; j++) { checkTailIteration(tree, added, p[i * j / 10]); } } tree.add(p[i]); added.add(p[i]); } }
public MutableTree<K> beginWrite() { return new MutableTree<>(this); }
Persistent23Tree extends AbstractPersistent23Tree<K> { public MutableTree<K> beginWrite() { return new MutableTree<>(this); } }
Persistent23Tree extends AbstractPersistent23Tree<K> { public MutableTree<K> beginWrite() { return new MutableTree<>(this); } Persistent23Tree();   Persistent23Tree(@Nullable final AbstractPersistent23Tree.RootNode<K> root); }
Persistent23Tree extends AbstractPersistent23Tree<K> { public MutableTree<K> beginWrite() { return new MutableTree<>(this); } Persistent23Tree();   Persistent23Tree(@Nullable final AbstractPersistent23Tree.RootNode<K> root); ImmutableTree<K> beginRead(); Persistent23Tree<K> getClone(); MutableTree<K> beginWrite(); }
Persistent23Tree extends AbstractPersistent23Tree<K> { public MutableTree<K> beginWrite() { return new MutableTree<>(this); } Persistent23Tree();   Persistent23Tree(@Nullable final AbstractPersistent23Tree.RootNode<K> root); ImmutableTree<K> beginRead(); Persistent23Tree<K> getClone(); MutableTree<K> beginWrite();  }