ClearStrategy extends AbstractTagStrategy { public void execute(final VoiceXmlInterpreterContext context, final VoiceXmlInterpreter interpreter, final FormInterpretationAlgorithm fia, final FormItem item, final VoiceXmlNode node) throws JVoiceXMLEvent { if ((namelist == null) || namelist.isEmpty()) { clearAllFormItems(context, fia); } else { clearVariables(context, fia); } } ClearStrategy(); Collection<String> getEvalAttributes(); @Override void validateAttributes(final DataModel model); void execute(final VoiceXmlInterpreterContext context,
            final VoiceXmlInterpreter interpreter,
            final FormInterpretationAlgorithm fia, final FormItem item,
            final VoiceXmlNode node);  }
@Test public void testExecute() throws Exception { final String var = "test"; final Block block = createBlock(); final Clear clear = block.appendChild(Clear.class); clear.setNamelist(var); final DataModel model = getDataModel(); Mockito.when(model.existsVariable(var)).thenReturn(true); ClearStrategy strategy = new ClearStrategy(); try { executeTagStrategy(clear, strategy); } catch (JVoiceXMLEvent e) { Assert.fail(e.getMessage()); } Mockito.verify(model).updateVariable(var, null); }