BaseFinishedSelectStatement extends BaseSqlPart implements FinishedSelectStatement { @NotNull @Override public final Iterator<SqlPart> iterator() { return new SqlPartIterator(this); }  @NotNull @Override final Iterator<SqlPart> iterator(); @Override T executeOn(@NotNull final StatementExecutor<T> statementExecutor);  }
@Test public void iterator_returnsProperIterator() { SqlPart sqlPart = mock(SqlPart.class); TestBaseFinishedSelectStatement statement = new TestBaseFinishedSelectStatement(sqlPart); Iterator<SqlPart> iterator = statement.iterator(); assertThat(iterator.hasNext(), is(true)); assertThat(iterator.next(), is((SqlPart) statement)); assertThat(iterator.hasNext(), is(true)); assertThat(iterator.next(), is(sqlPart)); assertThat(iterator.hasNext(), is(false)); }