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

    final GrammarCreator creator = new BooleanGrammarCreator();
    final URI dtmfUri = new URI("builtin:dtmf/boolean");
    final byte[] bytes1 = creator.createGrammar(dtmfUri);
    final ByteArrayInputStream in1 = new ByteArrayInputStream(bytes1);
    final InputSource source1 = new InputSource(in1);
    final SrgsXmlDocument dtmfDocument = new SrgsXmlDocument(source1);
    final Grammar dtmfGrammar = dtmfDocument.getGrammar();
    Assert.assertEquals(ModeType.DTMF, dtmfGrammar.getMode());
    final URI voiceUri = new URI("builtin:voice/boolean");
    final byte[] bytes2 = creator.createGrammar(voiceUri);
    final ByteArrayInputStream in2 = new ByteArrayInputStream(bytes2);
    final InputSource source2 = new InputSource(in2);
    final SrgsXmlDocument voiceDocument = new SrgsXmlDocument(source2);
    final Grammar voiceGrammar = voiceDocument.getGrammar();
    Assert.assertEquals(ModeType.VOICE, voiceGrammar.getMode());
}