OrExpression extends BooleanExpression { @Override public BooleanNode evaluate(final IJsonNode node) { for (final EvaluationExpression booleanExpression : this.expressions) if (booleanExpression.evaluate(node) == BooleanNode.TRUE) return BooleanNode.TRUE; return BooleanNode.FALSE; } OrExpression();  OrExpression(final BooleanExpression... expressions);  OrExpression(final List<BooleanExpression> expressions); @Override void appendAsString(final Appendable appendable); @Override boolean equals(final Object obj); @Override BooleanNode evaluate(final IJsonNode node); List<BooleanExpression> getExpressions(); @Override int hashCode(); @Override ChildIterator iterator(); static OrExpression valueOf(final BooleanExpression expression); static OrExpression valueOf(final List<? extends EvaluationExpression> childConditions);  }
@Test public void shouldBeFalseIfNoExprIsTrue() { final IJsonNode result = new OrExpression(FALSE, BooleanExpression.ensureBooleanExpression(EvaluationExpression.VALUE), FALSE). evaluate(BooleanNode.FALSE); Assert.assertEquals(BooleanNode.FALSE, result); }
@Test public void shouldBeTrueIfOneExprIsTrue() { final IJsonNode result = new OrExpression(FALSE, BooleanExpression.ensureBooleanExpression(EvaluationExpression.VALUE), FALSE). evaluate(BooleanNode.TRUE); Assert.assertEquals(BooleanNode.TRUE, result); }