ElementInSetExpression extends BinaryBooleanExpression { @Override public BooleanNode evaluate(final IJsonNode node) { return this.quantor.evaluate(this.elementExpr.evaluate(node), ElementInSetExpression.asIterator(this.setExpr.evaluate(node))); } ElementInSetExpression(final EvaluationExpression elementExpr, final Quantor quantor,
			final EvaluationExpression setExpr);   ElementInSetExpression(); @Override void appendAsString(final Appendable appendable); @Override boolean equals(final Object obj); @Override BooleanNode evaluate(final IJsonNode node); EvaluationExpression getElementExpr(); @Override EvaluationExpression getExpr1(); @Override EvaluationExpression getExpr2(); Quantor getQuantor(); EvaluationExpression getSetExpr(); @Override int hashCode(); @Override ChildIterator iterator();  }
@Test public void shouldFindElementInSet() { final IJsonNode result = new ElementInSetExpression(new InputSelection(0), Quantor.EXISTS_IN, new InputSelection(1)).evaluate( createArrayNode(IntNode.valueOf(2), createArrayNode(IntNode.valueOf(1), IntNode.valueOf(2), IntNode.valueOf(3)))); Assert.assertEquals(BooleanNode.TRUE, result); }
@Test public void shouldFindNonexistingElementInSet() { final IJsonNode result = new ElementInSetExpression(new InputSelection(0), Quantor.EXISTS_NOT_IN, new InputSelection(1)).evaluate( createArrayNode(IntNode.valueOf(2), createArrayNode(IntNode.valueOf(1), IntNode.valueOf(2), IntNode.valueOf(3)))); Assert.assertEquals(BooleanNode.FALSE, result); }
@Test public void shouldNotFindElementInSet() { final IJsonNode result = new ElementInSetExpression(new InputSelection(0), Quantor.EXISTS_IN, new InputSelection(1)).evaluate( createArrayNode(IntNode.valueOf(0), createArrayNode(IntNode.valueOf(1), IntNode.valueOf(2), IntNode.valueOf(3)))); Assert.assertEquals(BooleanNode.FALSE, result); }
@Test public void shouldNotFindNonexistingElementInSet() { final IJsonNode result = new ElementInSetExpression(new InputSelection(0), Quantor.EXISTS_NOT_IN, new InputSelection(1)).evaluate( createArrayNode(IntNode.valueOf(0), createArrayNode(IntNode.valueOf(1), IntNode.valueOf(2), IntNode.valueOf(3)))); Assert.assertEquals(BooleanNode.TRUE, result); }
@Test public void shouldReturnFalseIfSetIsEmpty() { final IJsonNode result = new ElementInSetExpression(new InputSelection(0), Quantor.EXISTS_IN, new InputSelection(1)).evaluate(createArrayNode(IntNode.valueOf(2), createArrayNode())); Assert.assertEquals(BooleanNode.FALSE, result); }