CommonTree oldRoot = new CommonTree(new CommonToken(101));
oldRoot.addChild(new CommonTree(new CommonToken(102)));
oldRoot.addChild(new CommonTree(new CommonToken(103)));
TreeAdaptor adaptor = new CommonTreeAdaptor();
adaptor.becomeRoot(newRoot, oldRoot);
newRoot.sanityCheckParentAndChildIndexes();
}
@Test public void testBecomeRoot3() throws Exception {
// ^(nil 5) becomes new root of ^(nil 101 102 103)