assertEquals(expecting, t.toStringTree());
t.sanityCheckParentAndChildIndexes();
}
@Test public void testReplaceAllWithTwo() throws Exception {
CommonTree t = new CommonTree(new CommonToken(99, "a"));
t.addChild(new CommonTree(new CommonToken(99, "b")));
t.addChild(new CommonTree(new CommonToken(99, "c")));
t.addChild(new CommonTree(new CommonToken(99, "d")));
CommonTree newChildren = (CommonTree)adaptor.nil();
newChildren.addChild(new CommonTree(new CommonToken(99,"x")));
newChildren.addChild(new CommonTree(new CommonToken(99,"y")));
t.replaceChildren(0, 2, newChildren);
String expecting = "(a x y)";
assertEquals(expecting, t.toStringTree());
t.sanityCheckParentAndChildIndexes();