### Question:
UIComponentInfo extends UIComponentBase { public String getVar() { String var = (String) getStateHelper().get(PropertyKeys.var); Assert.state(StringUtils.hasLength(var), "Please specify a 'var' for the ComponentInfo"); return var; }  @Override String getFamily(); String getFor(); void setFor(String forValue); String getVar(); void setVar(String var); @Override boolean getRendersChildren(); @Override void encodeChildren(final FacesContext context); static final String COMPONENT_FAMILY; }### Answer:
@Test public void shouldNeedVar() throws Exception { this.thrown.expect(IllegalStateException.class); this.thrown.expectMessage("Please specify a 'var' for the ComponentInfo"); this.uiComponentInfo.getVar(); }