public static Statement sanitize(
      final Statement node,
      final MetaStore metaStore) {
    return sanitize(node, metaStore, true);
  }
@Test
  public void shouldThrowOnDuplicateLambdaArgumentsInNestedLambda() {
    // Given:
    final Statement stmt1 = givenQuery(
        "SELECT TRANSFORM_ARRAY(Col4, X => TRANSFORM_ARRAY(Col4, X => X)) FROM TEST1;");
    final Statement stmt2 = givenQuery(
        "SELECT TRANSFORM_ARRAY(Col4, (X,Y,Z) => TRANSFORM_MAP(Col4, Q => TRANSFORM_ARRAY(Col4, T => T, X => X))) FROM TEST1;");

    final Exception e1 = assertThrows(
        KsqlException.class,
        () -> AstSanitizer.sanitize(stmt1, META_STORE)
    );
    final Exception e2 = assertThrows(
        KsqlException.class,
        () -> AstSanitizer.sanitize(stmt2, META_STORE)
    );

    // Then:
    assertThat(e1.getMessage(),
        containsString("Reusing lambda arguments in nested lambda is not allowed"));
    assertThat(e2.getMessage(),
        containsString("Reusing lambda arguments in nested lambda is not allowed"));
  }