UrlSelectorImpl implements UrlSelector { @Override public Optional<HttpUrl> redirectToNextRoundRobin(HttpUrl requestUrl) { List<HttpUrl> httpUrls = baseUrls.get(); int lastIndex = indexForLastBaseUrl(httpUrls); int nextIndex = increment(lastIndex, httpUrls); HttpUrl next = getNextHealthy(nextIndex, httpUrls).orElseGet(() -> httpUrls.get(nextIndex)); return redirectTo(requestUrl, next); } private  UrlSelectorImpl(
            ImmutableList<HttpUrl> baseUrls, boolean reshuffle, Duration failedUrlCooldown, Clock clock); @Override Optional<HttpUrl> redirectTo(HttpUrl requestUrl, String redirectUrl); @Override Optional<HttpUrl> redirectToNext(HttpUrl requestUrl); @Override Optional<HttpUrl> redirectToCurrent(HttpUrl requestUrl); @Override Optional<HttpUrl> redirectToNextRoundRobin(HttpUrl requestUrl); @Override void markAsSucceeded(HttpUrl succeededUrl); @Override void markAsFailed(HttpUrl failedUrl); @Override List<HttpUrl> getBaseUrls();  }
@Test public void testRedirectToNextRoundRobin() { UrlSelectorImpl selector = UrlSelectorImpl.create(list("http: HttpUrl current = HttpUrl.parse("http: String redirectTo = "http: assertThat(selector.redirectTo(current, redirectTo)).contains(HttpUrl.parse("http: assertThat(selector.redirectToNextRoundRobin(current)).contains(HttpUrl.parse("http: assertThat(selector.redirectToNextRoundRobin(current)).contains(HttpUrl.parse("http: }