@Test
public void testCreateGrammarParamters() throws Exception, BadFetchError {

    final GrammarCreator creator = new DigitsGrammarCreator();
    final URI dtmfUri = new URI(
            "builtin:dtmf/digits?minlength=2;maxlength=4");
    final byte[] bytes1 = creator.createGrammar(dtmfUri);
    final ByteArrayInputStream in1 = new ByteArrayInputStream(bytes1);
    final InputSource source1 = new InputSource(in1);
    final SrgsXmlDocument document1 = new SrgsXmlDocument(source1);
    final Grammar dtmfGrammar = document1.getGrammar();
    Assert.assertEquals(ModeType.DTMF, dtmfGrammar.getMode());
    final Item dtmfItem = getRootItem(document1);
    Assert.assertEquals("2-4", dtmfItem.getRepeat());
    final URI voiceUri = new URI(
            "builtin:voice/digits?minlength=2;maxlength=4");
    final byte[] bytes2 = creator.createGrammar(voiceUri);
    final ByteArrayInputStream in2 = new ByteArrayInputStream(bytes2);
    final InputSource source2 = new InputSource(in2);
    final SrgsXmlDocument document2 = new SrgsXmlDocument(source2);
    final Grammar voiceGrammar = document2.getGrammar();
    Assert.assertEquals(ModeType.VOICE, voiceGrammar.getMode());
    final Item voiceItem = getRootItem(document2);
    Assert.assertEquals("2-4", voiceItem.getRepeat());
}