BaseFinishedSelectStatement extends BaseSqlPart implements FinishedSelectStatement { @Override public <T> T executeOn(@NotNull final StatementExecutor<T> statementExecutor) { return statementExecutor.execute(this); }  @NotNull @Override final Iterator<SqlPart> iterator(); @Override T executeOn(@NotNull final StatementExecutor<T> statementExecutor);  }
@Test public void executeOn_delegatesToParameter() { StatementExecutor<?> statementExecutor = mock(StatementExecutor.class); TestBaseFinishedSelectStatement query = new TestBaseFinishedSelectStatement(mock(SqlPart.class)); query.executeOn(statementExecutor); verify(statementExecutor).execute(query); }