@VisibleForTesting
  Object evaluate(final GenericRow row) {
    return term.getValue(new TermEvaluationContext(row));
  }
@Test
  public void shouldEvaluateCastToArray() {
    // Given:
    final Expression cast1 = new Cast(
        new CreateArrayExpression(ImmutableList.of(
            new StringLiteral("1"), new StringLiteral("2"))),
        new Type(SqlTypes.array(SqlTypes.INTEGER))
    );
    final Expression cast2 = new Cast(
        new CreateArrayExpression(ImmutableList.of(
            new DoubleLiteral(2.5), new DoubleLiteral(3.6))),
        new Type(SqlTypes.array(SqlTypes.INTEGER))
    );
    final Expression cast3 = new Cast(
        new CreateArrayExpression(ImmutableList.of(
            new DoubleLiteral(2.5), new DoubleLiteral(3.6))),
        new Type(SqlTypes.array(SqlTypes.STRING))
    );

    // When:
    InterpretedExpression interpreter1 = interpreter(cast1);
    InterpretedExpression interpreter2 = interpreter(cast2);
    InterpretedExpression interpreter3 = interpreter(cast3);

    // Then:
    assertThat(interpreter1.evaluate(ROW), is(ImmutableList.of(1, 2)));
    assertThat(interpreter2.evaluate(ROW), is(ImmutableList.of(2, 3)));
    assertThat(interpreter3.evaluate(ROW), is(ImmutableList.of("2.5", "3.6")));
  }