@Override
    public Object evaluate(EvaluationContext ctx) {
        try {
            ctx.enterFrame();
            List<Object> toReturn = new ArrayList<>();
            ctx.setValue("partial", toReturn);
            populateToReturn(0, ctx, toReturn);
            LOG.trace("returning {}", toReturn);
            return toReturn;
        } catch (EndpointOfRangeNotValidTypeException | EndpointOfRangeOfDifferentTypeException e) {
            // ast error already reported
            return null;
        } finally {
            ctx.exitFrame();
        }
    }
@Test
    void evaluateSimpleArray() {
        IterationContextNode x = getIterationContextNode("x", getListNode("[ 1, 2, 3, 4 ]", Arrays.asList("1", "2", "3", "4")), "x in [ 1, 2, 3, 4 ]");
        IterationContextNode y = getIterationContextNode("y", getNameRefNode(BuiltInType.UNKNOWN, "x"), "y in x");
        ForExpressionNode forExpressionNode = new ForExpressionNode(Arrays.asList(x, y), getNameRefNode(BuiltInType.UNKNOWN, "y"), "for x in [ 1, 2, 3, 4 ], y in x return y");
        Object retrieved = forExpressionNode.evaluate(CodegenTestUtil.newEmptyEvaluationContext());
        assertThat(retrieved).isInstanceOf(List.class).asList().
                containsExactly(BigDecimal.ONE, BigDecimal.valueOf(2), BigDecimal.valueOf(3), BigDecimal.valueOf(4));
    }