CreateTableImpl extends BaseFinishedStatement implements CreateTable { @Nullable @Override public SqlPart previous() { return mPrevious; } CreateTableImpl(@Nullable final String databaseName, @NotNull final String tableName, @NotNull final SqlPart previous); @Override void prependTo(@NotNull final RawSqlBuilder builder); @Nullable @Override SqlPart previous(); @NotNull @Override CreateColumns columns(@NotNull final Column... columns); @NotNull @Override As as(@NotNull final FinishedSelectStatement select);  }
@Test public void previous_returnsProperItem() { SqlPart sqlPart = mock(SqlPart.class); CreateTableImpl createTable = new CreateTableImpl(null, "table", sqlPart); SqlPart result = createTable.previous(); assertThat(result, is(sqlPart)); }