### Question:
SqlCommand extends SqlStatement { @NotNull @Override public SqlCommand rewrite(@NotNull final StringOperator operator) { String transformedSourceTex = operator.apply(mySourceText); return new SqlCommand(myRow, transformedSourceTex, myName, myDescription); } SqlCommand(@NotNull final TextFragment sourceFragment);  SqlCommand(@NotNull final String sourceText, final int row, @Nullable final String commandName);  SqlCommand(@NotNull final String sourceText); private  SqlCommand(final int row,
                     @NotNull final String sourceText,
                     @Nullable final String name,
                     @NotNull final String description); @NotNull @Override SqlCommand rewrite(@NotNull final StringOperator operator);  }### Answer:
@Test public void rewrite_basic() { SqlCommand cmd1 = new SqlCommand("AAA BBB CCC", 33, "name"); SqlCommand cmd2 = cmd1.rewrite(Rewriters.replace("BBB", "XXX")); assertThat(cmd2.getSourceText()).isEqualTo("AAA XXX CCC"); assertThat(cmd2.getRow()).isEqualTo(33); assertThat(cmd2.getName()).isEqualTo("name"); }