@Test public void shouldReuseTarget() { final ArrayCreation arrayCreation = new ArrayCreation(new ConstantExpression(IntNode.valueOf(42))); final IJsonNode result1 = arrayCreation.evaluate(IntNode.valueOf(42)); final IJsonNode result2 = arrayCreation.evaluate(IntNode.valueOf(42)); Assert.assertEquals(new ArrayNode<IJsonNode>(IntNode.valueOf(42)), result1); Assert.assertSame(result1, result2); Assert.assertEquals(new ArrayNode<IJsonNode>(IntNode.valueOf(42)), result2); }
@Override public IJsonNode evaluate(final IJsonNode node) { this.result.clear(); for (int index = 0; index < this.elements.size(); index++) this.result.add(this.elements.get(index).evaluate(node)); return this.result; }
ArrayCreation extends EvaluationExpression { @Override public IJsonNode evaluate(final IJsonNode node) { this.result.clear(); for (int index = 0; index < this.elements.size(); index++) this.result.add(this.elements.get(index).evaluate(node)); return this.result; } }
ArrayCreation extends EvaluationExpression { @Override public IJsonNode evaluate(final IJsonNode node) { this.result.clear(); for (int index = 0; index < this.elements.size(); index++) this.result.add(this.elements.get(index).evaluate(node)); return this.result; } ArrayCreation();  ArrayCreation(final EvaluationExpression... elements);  ArrayCreation(final List<EvaluationExpression> elements); }
ArrayCreation extends EvaluationExpression { @Override public IJsonNode evaluate(final IJsonNode node) { this.result.clear(); for (int index = 0; index < this.elements.size(); index++) this.result.add(this.elements.get(index).evaluate(node)); return this.result; } ArrayCreation();  ArrayCreation(final EvaluationExpression... elements);  ArrayCreation(final List<EvaluationExpression> elements); ArrayCreation add(final EvaluationExpression expression); @Override void appendAsString(final Appendable appendable); @Override boolean equals(final Object obj); @Override IJsonNode evaluate(final IJsonNode node); EvaluationExpression get(final int index); List<EvaluationExpression> getElements(); @Override int hashCode(); @Override ChildIterator iterator(); int size(); }
ArrayCreation extends EvaluationExpression { @Override public IJsonNode evaluate(final IJsonNode node) { this.result.clear(); for (int index = 0; index < this.elements.size(); index++) this.result.add(this.elements.get(index).evaluate(node)); return this.result; } ArrayCreation();  ArrayCreation(final EvaluationExpression... elements);  ArrayCreation(final List<EvaluationExpression> elements); ArrayCreation add(final EvaluationExpression expression); @Override void appendAsString(final Appendable appendable); @Override boolean equals(final Object obj); @Override IJsonNode evaluate(final IJsonNode node); EvaluationExpression get(final int index); List<EvaluationExpression> getElements(); @Override int hashCode(); @Override ChildIterator iterator(); int size();  }