public AstNode rewrite(final AstNode node, final C context) {
    return rewriter.process(node, context);
  }
@Test
  public void shouldRewriteJoinWithWindowExpression() {
    // Given:
    final WithinExpression withinExpression = mock(WithinExpression.class);
    final WithinExpression rewrittenWithinExpression = mock(WithinExpression.class);
    final Join join = givenJoin(Optional.of(withinExpression));
    when(mockRewriter.apply(withinExpression, context)).thenReturn(rewrittenWithinExpression);

    // When:
    final AstNode rewritten = rewriter.rewrite(join, context);

    // Then:
    assertThat(
        rewritten,
        equalTo(
            new Join(
                location,
                rewrittenRelation,
                ImmutableList.of(new JoinedSource(
                    Optional.empty(),
                    rewrittenRightRelation,
                    Type.LEFT,
                    joinCriteria,
                    Optional.of(rewrittenWithinExpression)))))
    );
  }