AbstractFormItem implements FormItem, FormItemLocalExecutableTagContainer { @Override public boolean isSelectable() throws SemanticError { final Object result = getFormItemVariable(); final boolean cond = evaluateCondition(); final DataModel model = context.getDataModel(); final boolean selectable = ((result == model.getUndefinedValue()) || (result == null)) && cond; if (LOGGER.isDebugEnabled()) { LOGGER.debug("checking if '" + name +"' is selectable"); final String logResult = model.toString(result); LOGGER.debug("value of '" + name + "': '" + logResult + "'"); LOGGER.debug("cond of '" + name + "': '" + cond + "'"); LOGGER.debug("selectable '" + name + "': " + selectable); } return selectable; } AbstractFormItem();   AbstractFormItem(final VoiceXmlInterpreterContext ctx,
            final VoiceXmlNode voiceNode); abstract AbstractFormItem newInstance(
            final VoiceXmlInterpreterContext ctx, final VoiceXmlNode voiceNode); @Override final Object getFormItemVariable(); @Override int setFormItemVariable(final Object value); @Override final String getName(); @Override final Object evaluateExpression(final DataModel model); @Override boolean evaluateCondition(); @Override boolean isSelectable(); @Override final VoiceXmlNode getNode(); @Override final String getNodeTagName(); Collection<AbstractCatchElement> getCatchElements(); Collection<VoiceXmlNode> getLocalExecutableTags();  }
@Test public void testIsSelectable() throws JVoiceXMLEvent { final DataModel model = Mockito.mock(DataModel.class); Mockito.when(model.readVariable(item.getName(), Object.class)) .thenReturn(null); Mockito.when(context.getDataModel()).thenReturn(model); Assert.assertTrue(item.isSelectable()); }