@Test
public void testCreateDtmfGrammar() throws Exception  {

    final VoiceXmlDocument document = new VoiceXmlDocument();
    final Vxml vxml = document.getVxml();
    final Form form = vxml.appendChild(Form.class);
    final Field field = form.appendChild(Field.class);
    final Option option1 = field.appendChild(Option.class);
    option1.addText("one");
    option1.setDtmf("1");
    final Option option2 = field.appendChild(Option.class);
    option2.addText("two");
    final Option option3 = field.appendChild(Option.class);
    option3.addText("three");
    option3.setDtmf("3");
    final Collection<Option> options = field.getChildNodes(Option.class);
    final OptionConverter converter = new SrgsXmlOptionConverter();
    final Grammar grammar = converter.createDtmfGrammar(options);
    final Rule rule = grammar.getRootRule();
    Assert.assertNotNull(rule);
    final OneOf oneof = rule.getChildNodes(OneOf.class).iterator().next();
    Assert.assertNotNull(oneof);
    final Collection<Item> items = oneof.getChildNodes(Item.class);
    Assert.assertEquals(2, items.size());
    final Iterator<Item> iterator = items.iterator();
    final Item item1 = iterator.next();
    Assert.assertEquals(option1.getDtmf(), item1.getTextContent());
    final Item item3 = iterator.next();
    Assert.assertEquals(option3.getDtmf(), item3.getTextContent());
}