public static String formatSql(final AstNode root) {
    final StringBuilder builder = new StringBuilder();
    new Formatter(builder).process(root, 0);
    return StringUtils.stripEnd(builder.toString(), "\n");
  }
@Test
  public void shouldFormatCreateOrReplaceStreamStatement() {
    // Given:
    final CreateSourceProperties props = CreateSourceProperties.from(
        new ImmutableMap.Builder<String, Literal>()
            .putAll(SOME_WITH_PROPS.copyOfOriginalLiterals())
            .build()
    );
    final CreateStream createTable = new CreateStream(
        TEST,
        ELEMENTS_WITHOUT_KEY,
        true,
        false,
        props,
        false);

    // When:
    final String sql = SqlFormatter.formatSql(createTable);

    // Then:
    assertThat(sql, is("CREATE OR REPLACE STREAM TEST (`Foo` STRING, `Bar` STRING) "
        + "WITH (KAFKA_TOPIC='topic_test', VALUE_FORMAT='JSON');"));
  }