NotCondition extends AbstractCondition { @Override public boolean matches(RenderContext context) { if (subCondition == null) { throw new IllegalStateException("Sub condition was not specified."); } return !subCondition.matches(context); } NotCondition(ConditionFactory conditionFactory);  NotCondition(ConditionFactory conditionFactory,
			Condition subCondition); String getName(); Condition getSubCondition(); void setSubCondition(Condition subCondition); @Override boolean matches(RenderContext context); @Override Serializable saveState(); @Override void restoreState(Serializable state); @Override void saveSettings(HierarchicalConfiguration configuration); @Override void restoreSettings(HierarchicalConfiguration configuration); @Override String toString(); static final String NAME; }
@Test(expected = IllegalStateException.class) public void testEmptyCondition() { RenderContext context = createDummyRenderContext(); NotCondition not = new NotCondition(conditionFactory); not.matches(context); }