@SuppressWarnings("unchecked")
  public <T extends Expression> T rewrite(final T expression, final C context) {
    return (T) rewriter.process(expression, context);
  }
@Test
  public void shouldRewriteCreateArrayExpression() {
    // Given:
    final CreateArrayExpression parsed = parseExpression("ARRAY['foo', col4[1]]");
    final Expression firstVal = parsed.getValues().get(0);
    final Expression secondVal = parsed.getValues().get(1);
    when(processor.apply(firstVal, context)).thenReturn(expr1);
    when(processor.apply(secondVal, context)).thenReturn(expr2);

    // When:
    final Expression rewritten = expressionRewriter.rewrite(parsed, context);

    // Then:
    assertThat(rewritten, equalTo(new CreateArrayExpression(ImmutableList.of(expr1, expr2))));
  }