// two leaf trees
RevTree left = createFeaturesTree(leftSource, "f", 3).build();
RevTree right = createFeaturesTree(rightSource, "f", 5).build();
PreOrderDiffWalk visitor = new PreOrderDiffWalk(left, right, leftSource, rightSource);
final Node lroot = nodeFor(left);
final Node rroot = nodeFor(right);
when(consumer.tree(eq(lroot), eq(rroot))).thenReturn(true);
visitor.walk(consumer);
verify(consumer, times(1)).tree(eq(lroot), eq(rroot));
ArgumentCaptor<Node> larg = ArgumentCaptor.forClass(Node.class);
ArgumentCaptor<Node> rarg = ArgumentCaptor.forClass(Node.class);
verify(consumer, times(2)).feature(larg.capture(), rarg.capture());
assertEquals(2, larg.getAllValues().size());
assertNull(larg.getAllValues().get(0));
assertNull(larg.getAllValues().get(1));
Node n1 = featureNode("f", 3);// the two added nodes
Node n2 = featureNode("f", 4);
assertTrue(rarg.getAllValues().contains(n1));
assertTrue(rarg.getAllValues().contains(n2));
verify(consumer, times(1)).endTree(eq(lroot), eq(rroot));
verifyNoMoreInteractions(consumer);