class IntoImpl extends BaseSqlPart implements Into {

  @Override
  public void prependTo(@NotNull final RawSqlBuilder builder) {
    builder.prepend(mTableName);

    if (mDatabaseName != null) {
      builder.prepend('.').prepend(mDatabaseName);
    }

    builder.prepend("INTO ");
  }

}

class IntoImplTest {

  @Test
  public void prependTo_table_prependsProperSql() {

    /* Given */
    IntoImpl into = new IntoImpl(null, "table", mock(SqlPart.class));
    RawSqlBuilder builder = new RawSqlBuilderImpl();

    /* When */
    into.prependTo(builder);

    /* Then */
    assertThat(builder.toString(), is("INTO table"));
  }

}