assertEquals("foo", labels.get("b").toString());
assertEquals("C", labels.get("c").toString());
}
@Test public void testParseLabelsInNestedTree() throws Exception {
TreeWizard wiz = new TreeWizard(adaptor, tokens);
CommonTree t = (CommonTree)wiz.create("(A (B C) (D E))");
Map labels = new HashMap();
boolean valid = wiz.parse(t, "(%a:A (%b:B %c:C) (%d:D %e:E) )", labels);
assertTrue(valid);
assertEquals("A", labels.get("a").toString());
assertEquals("B", labels.get("b").toString());
assertEquals("C", labels.get("c").toString());
assertEquals("D", labels.get("d").toString());