RenameToImpl extends BaseFinishedStatement implements RenameTo { @Nullable @Override public SqlPart previous() { return mPrevious; } RenameToImpl(@NotNull final String newTableName, @NotNull final SqlPart previous); @Override void prependTo(@NotNull final RawSqlBuilder builder); @Nullable @Override SqlPart previous();  }
@Test public void previous_returnsProperItem() { SqlPart sqlPart = mock(SqlPart.class); RenameToImpl renameTo = new RenameToImpl("table", sqlPart); SqlPart result = renameTo.previous(); assertThat(result, is(sqlPart)); }