@Test
public void testGetRules() throws Exception {

    final SrgsXmlDocument document = new SrgsXmlDocument();
    final Grammar grammar = document.getGrammar();
    final Rule rule1 = grammar.appendChild(Rule.class);
    grammar.setRoot(rule1);
    rule1.makePublic();
    rule1.setId("test1");
    final Rule rule2 = grammar.appendChild(Rule.class);
    rule2.setId("test2");
    final Rule rule3 = grammar.appendChild(Rule.class);
    rule3.setId("test3");
    rule3.makePublic();
    final Collection<Rule> rules = grammar.getRules();
    Assert.assertEquals(3, rules.size());
}