OrExpression extends BooleanExpression { @Override public IJsonNode evaluate(final IJsonNode node, final IJsonNode target, final EvaluationContext context) { for (final EvaluationExpression booleanExpression : this.expressions) if (booleanExpression.evaluate(node, null, context) == BooleanNode.TRUE) return BooleanNode.TRUE; return BooleanNode.FALSE; } OrExpression(final BooleanExpression... expressions);  OrExpression(final List<BooleanExpression> expressions); @Override boolean equals(final Object obj); @Override IJsonNode evaluate(final IJsonNode node, final IJsonNode target, final EvaluationContext context); @Override EvaluationExpression transformRecursively(final TransformFunction function); List<BooleanExpression> getExpressions(); @Override int hashCode(); @Override void toString(final StringBuilder builder); static OrExpression valueOf(final BooleanExpression expression); static OrExpression valueOf(final List<? extends EvaluationExpression> childConditions);  }
@Test public void shouldBeTrueIfOneExprIsTrue() { final IJsonNode result = new OrExpression(FALSE, BooleanExpression.ensureBooleanExpression(EvaluationExpression.VALUE), FALSE). evaluate(BooleanNode.TRUE, null, this.context); Assert.assertEquals(BooleanNode.TRUE, result); }
@Test public void shouldBeFalseIfNoExprIsTrue() { final IJsonNode result = new OrExpression(FALSE, BooleanExpression.ensureBooleanExpression(EvaluationExpression.VALUE), FALSE). evaluate(BooleanNode.FALSE, null, this.context); Assert.assertEquals(BooleanNode.FALSE, result); }