### Question:
OrCondition implements Condition { @Override public boolean isSatisfiable(ConditionContext context) { for(Condition condition: conditions) { if(condition.isSatisfiable(context)) { return true; } } return false; } OrCondition(List<Condition> conditions); @Override boolean isSatisfiable(ConditionContext context); @Override boolean handlesEventsOfType(RuleEventType type); @Override void activate(ConditionContext context); @Override void deactivate(ConditionContext context); @Override boolean shouldFire(ConditionContext context, RuleEvent event); @Override boolean isSimpleTrigger();  }### Answer:
@Test public void testNoneSatisfiable() { EasyMock .expect(cond1.isSatisfiable(context)) .andReturn(false); EasyMock .expect(cond2.isSatisfiable(context)) .andReturn(false); EasyMock .expect(cond3.isSatisfiable(context)) .andReturn(false); replay(); assertEquals(false, condition.isSatisfiable(context)); verify(); }
@Test public void testOneSatisfiable() { EasyMock .expect(cond1.isSatisfiable(context)) .andReturn(false); EasyMock .expect(cond2.isSatisfiable(context)) .andReturn(false); EasyMock .expect(cond3.isSatisfiable(context)) .andReturn(true); replay(); assertEquals(true, condition.isSatisfiable(context)); verify(); }
@Test public void testAllSatisfiable() { EasyMock .expect(cond1.isSatisfiable(context)) .andReturn(true) .anyTimes(); EasyMock .expect(cond2.isSatisfiable(context)) .andReturn(true) .anyTimes(); EasyMock .expect(cond3.isSatisfiable(context)) .andReturn(true) .anyTimes(); replay(); assertEquals(true, condition.isSatisfiable(context)); verify(); }