LimitImpl extends BaseFinishedSelectStatement implements Limit { @Override public void prependTo(@NotNull final RawSqlBuilder builder) { builder.prepend(mLimit).prepend("LIMIT "); } LimitImpl(final long limit, @NotNull final SqlPart previous); @Override void prependTo(@NotNull final RawSqlBuilder builder); @Nullable @Override SqlPart previous();  }
@Test public void prependTo_prependsProperSql() { LimitImpl limit = new LimitImpl(5, mock(SqlPart.class)); RawSqlBuilder builder = new RawSqlBuilderImpl(); limit.prependTo(builder); assertThat(builder.toString(), is("LIMIT 5")); }