for (TreeRange range : mt.invalids())
range.addAll(new HIterator(range.right));
for (TreeRange range : mt2.invalids())
range.addAll(new HIterator(range.right));
TreeRange leftmost = null;
TreeRange middle = null;
mt.maxsize(maxsize + 2); // give some room for splitting
// split the leftmost
Iterator<TreeRange> ranges = mt.invalids();
leftmost = ranges.next();
mt.split(leftmost.right);
// set the hashes for the leaf of the created split
middle = mt.get(leftmost.right);
middle.hash("arbitrary!".getBytes());
mt.get(partitioner.midpoint(leftmost.left, leftmost.right)).hash("even more arbitrary!".getBytes());
// trees should disagree for (leftmost.left, middle.right]
List<TreeRange> diffs = MerkleTree.difference(mt, mt2);
assertEquals(diffs + " contains wrong number of differences:", 1, diffs.size());