Assert.assertNotNull(g);
Rule[] listItemRules = rulesForName(g.getRules(), "list_item");
Assert.assertEquals(2, listItemRules.length);
Symbol s = listItemRules[0].getLeft();
Assert.assertEquals(5, s.getAnnotation("weight"));
Assert.assertEquals("wwo", s.getAnnotation("name"));
Assert.assertEquals("rule1", listItemRules[0].getAnnotation("name"));
Assert.assertEquals("rule2", listItemRules[1].getAnnotation("name"));
Object val = listItemRules[0].getRight()[0].getAnnotation("ids");
Assert.assertTrue(val instanceof List<?>);
List<?> list = (List<?>) val;
Assert.assertEquals(3, list.size());
Assert.assertEquals(4, list.get(0));
Assert.assertEquals(2, list.get(1));
Assert.assertEquals(3, list.get(2));
Rule[] inputRules = rulesForName(g.getRules(), "input");
Assert.assertEquals(1, inputRules.length);
Symbol input = inputRules[0].getLeft();
Assert.assertNotNull(input);
Object refval = input.getAnnotation("ref");
Assert.assertNotNull(refval);
Assert.assertTrue(refval instanceof Symbol);
Assert.assertTrue(refval == s);
}