AddColumnImpl extends BaseFinishedStatement implements AddColumn { @Override public void prependTo(@NotNull final RawSqlBuilder builder) { mColumn.prependTo(builder); builder.prepend("ADD COLUMN "); } AddColumnImpl(@NotNull final Column column, @NotNull final SqlPart previous); @Override void prependTo(@NotNull final RawSqlBuilder builder); @Nullable @Override SqlPart previous();  }
@Test public void prependTo_prependsProperSql() { Column columnMock = new Column() { @Override public void prependTo(@NotNull final RawSqlBuilder builder) { builder.prepend("test_column"); } @Nullable @Override public SqlPart previous() { return null; } @Nullable @Override public Object[] getArguments() { return null; } }; SqlPart sqlPart = mock(SqlPart.class); AddColumnImpl addColumn = new AddColumnImpl(columnMock, sqlPart); RawSqlBuilder builder = new RawSqlBuilderImpl(); addColumn.prependTo(builder); assertThat(builder.toString(), is("ADD COLUMN test_column")); }