ArrayProjection extends PathSegmentExpression { @Override public ChildIterator iterator() { return new ConcatenatingChildIterator(super.iterator(), new NamedChildIterator("projection") { @Override protected EvaluationExpression get(final int index) { return ArrayProjection.this.projection; } @Override protected void set(final int index, final EvaluationExpression childExpression) { ArrayProjection.this.projection = childExpression; } }); } ArrayProjection(final EvaluationExpression projection); protected  ArrayProjection(); @Override void appendAsString(final Appendable appendable); @Override boolean equalsSameClass(final PathSegmentExpression other); EvaluationExpression getProjection(); @Override ChildIterator iterator(); @Override EvaluationExpression simplify(); @Override ArrayProjection withInputExpression(final EvaluationExpression inputExpression);  }
@SuppressWarnings("unchecked") @Test public void shouldAccessFieldOfStreamArray() { final ArrayProjection arrayProjection = new ArrayProjection(new ObjectAccess("fieldName")); final IJsonNode result = arrayProjection.evaluate( createStreamArrayNode(createObjectNode("fieldName", 1), createObjectNode("fieldName", 2), createObjectNode("fieldName", 3))); Assert.assertFalse(result instanceof IArrayNode); Assert.assertTrue(result instanceof IStreamNode); AssertUtil.assertIteratorEquals(createArrayNode(1, 2, 3).iterator(), ((Iterable<IJsonNode>) result).iterator()); }