@Test
public void testCollect() 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);
    field.appendChild(Filled.class);
    field.appendChild(Noinput.class);
    field.appendChild(Help.class);
    final Catch catchNode = field.appendChild(Catch.class);
    catchNode.setEvent("test");
    final FieldFormItem item = new FieldFormItem(context, field);
    final JVoiceXmlEventHandler handler = new JVoiceXmlEventHandler(null,
            null);
    handler.collect(context, interpreter, null, item);
    final Collection<EventStrategy> strategies = handler.getStrategies();
    Assert.assertEquals(6, strategies.size());
    Assert.assertTrue("expected to find type test",
            containsType(strategies, "test"));
    Assert.assertTrue("expected to find type noinput",
            containsType(strategies, "noinput"));
    Assert.assertTrue("expected to find type help",
            containsType(strategies, "help"));
    Assert.assertTrue("expected to find type cancel",
            containsType(strategies, "cancel"));
    Assert.assertTrue("expected to find type "
            + RecognitionEvent.EVENT_TYPE,
            containsType(strategies, RecognitionEvent.EVENT_TYPE));
}