assertEquals(3, c2.childIndex);
}
@Test public void testDupTree() throws Exception {
// ^(101 ^(102 103 ^(106 107) ) 104 105)
CommonTree r0 = new CommonTree(new CommonToken(101));
CommonTree r1 = new CommonTree(new CommonToken(102));
r0.addChild(r1);
r1.addChild(new CommonTree(new CommonToken(103)));
Tree r2 = new CommonTree(new CommonToken(106));
r2.addChild(new CommonTree(new CommonToken(107)));
r1.addChild(r2);
r0.addChild(new CommonTree(new CommonToken(104)));
r0.addChild(new CommonTree(new CommonToken(105)));
CommonTree dup = (CommonTree)(new CommonTreeAdaptor()).dupTree(r0);
assertNull(dup.parent);
assertEquals(-1, dup.childIndex);