@SuppressWarnings("unchecked")
  public <T extends Expression> T rewrite(final T expression, final C context) {
    return (T) rewriter.process(expression, context);
  }
@Test
  public void shouldRewriteInListExpression() {
    // Given:
    final InPredicate inPredicate = parseExpression("1 IN (1, 2, 3)");
    final InListExpression parsed = inPredicate.getValueList();
    when(processor.apply(parsed.getValues().get(0), context)).thenReturn(expr1);
    when(processor.apply(parsed.getValues().get(1), context)).thenReturn(expr2);
    when(processor.apply(parsed.getValues().get(2), context)).thenReturn(expr3);

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

    // Then:
    assertThat(
        rewritten,
        equalTo(new InListExpression(parsed.getLocation(), ImmutableList.of(expr1, expr2, expr3)))
    );
  }