SelectWhereImpl extends BaseFinishedSelectStatement implements SelectWhere { @Nullable @Override public SqlPart previous() { return mPrevious; } SelectWhereImpl(@NotNull final String expression, @NotNull final Object[] arguments, @NotNull final SqlPart previous); @NotNull @Override GroupBy groupBy(@NotNull final String expression); @NotNull @Override OrderBy orderBy(@NotNull final String... terms); @NotNull @Override Limit limit(final long limit); @Override void prependTo(@NotNull final RawSqlBuilder builder); @Nullable @Override Object[] getArguments(); @Nullable @Override SqlPart previous();  }
@Test public void previous_returnsProperItem() { SqlPart sqlPart = mock(SqlPart.class); SelectWhereImpl where = new SelectWhereImpl("a=?", new Object[] {1}, sqlPart); SqlPart result = where.previous(); assertThat(result, is(sqlPart)); }