@SuppressWarnings("unchecked")
  public <T extends Expression> T rewrite(final T expression, final C context) {
    return (T) rewriter.process(expression, context);
  }
@Test
  public void shouldRewriteStructExpression() {
    // Given:
    final CreateStructExpression parsed = parseExpression("STRUCT(FOO := 'foo', BAR := col4[1])");
    final Expression fooVal = parsed.getFields().stream().filter(f -> f.getName().equals("FOO")).findFirst().get().getValue();
    final Expression barVal = parsed.getFields().stream().filter(f -> f.getName().equals("BAR")).findFirst().get().getValue();
    when(processor.apply(fooVal, context)).thenReturn(expr1);
    when(processor.apply(barVal, context)).thenReturn(expr2);

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

    // Then:
    assertThat(rewritten, equalTo(new CreateStructExpression(ImmutableList.of(new Field("FOO", expr1), new Field("BAR", expr2)))));
  }