class RoundRobinConnectionStrategy extends AbstractConnectionStrategy {

  @Override
  public synchronized Iterator<LdapURL> iterator()
  {
    if (!isInitialized()) {
      throw new IllegalStateException("Strategy is not initialized");
    }
    final List<LdapURL> urls = new ArrayList<>(ldapURLSet.getActiveUrls());
    if (urls.size() > 1) {
      for (int i = 0; i < counter.get(); i++) {
        urls.add(urls.remove(0));
      }
    }
    urls.addAll(ldapURLSet.getInactiveUrls());
    counter.incrementAndGet();
    if (iterFunction != null) {
      return iterFunction.apply(ldapURLSet.getUrls());
    }
    return new DefaultLdapURLIterator(urls);
  }

  public  RoundRobinConnectionStrategy();
  public  RoundRobinConnectionStrategy(final Function<List<LdapURL>, Iterator<LdapURL>> function);

}