private ProxySelector nextSelector() {
        final int nextIndex = sharedIndex.getAndUpdate(i -> (i + 1) % selectors.size());
        return selectors.get(nextIndex);
    }
Retrieves the next available {@link ProxySelector} in the list of selectors,
incrementing the shared index atomically to ensure proper distribution
across different threads.

@return the next {@link ProxySelector} in the list.
httpclient5/src/main/java/org/apache/hc/client5/http/impl/routing/DistributedProxySelector.java