@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 evaluateNestedArray() {
        Map<String, List<String>> firstIterationContext = new LinkedHashMap<>();
        firstIterationContext.put("1, 2", Arrays.asList("1", "2"));
        firstIterationContext.put("3, 4", Arrays.asList("3", "4"));
        IterationContextNode x = getIterationContextNode("x", getNestedListNode("[ [1, 2], [3, 4] ]", firstIterationContext), "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));

    }