core/src/main/java/org/mobicents/ha/javax/sip/RoundRobinLoadBalancerElector.java
private int getNextIndex() {
		for (;;) {
            int current = index.get();
            int next = (current == balancers.size() ? 1 : current + 1);
            if (index.compareAndSet(current, next))
                return next-1;
        }
	}
private int getNextIndex() {
		for (;;) {
            int current = index.get();
            int next = (current == balancers.size() ? 1 : current + 1);
            if (index.compareAndSet(current, next))
                return next-1;
        }
	}
Computes the index of the next balancer to retrieve. Adaptation of the {@link AtomicInteger} incrementAndGet() code.

@return