DeferredImpl extends BaseSqlPart implements Deferred { @Nullable @Override public SqlPart previous() { return mSqlPart; } DeferredImpl(@NotNull final SqlPart sqlPart); @NotNull @Override Transaction transaction(); @Override void prependTo(@NotNull final RawSqlBuilder builder); @Nullable @Override SqlPart previous();  }
@Test public void previous_returnsProperItem() { SqlPart sqlPart = mock(SqlPart.class); DeferredImpl deferred = new DeferredImpl(sqlPart); SqlPart result = deferred.previous(); assertThat(result, is(sqlPart)); }