api/java/src/main/java/com/navercorp/redis/cluster/gateway/GatewayServerSelector.java
GatewayServer roundrobin(List<GatewayServer> list) {
        int index = this.seq.getAndIncrement();
        if(index < 0) {
            this.seq.set(0);
            index = 0;
        }

        final int size = list.size();
        if (index != 0 && index >= size) {
            index = index % size;
        }

        return list.get(index);
    }
GatewayServer roundrobin(List<GatewayServer> list) {
        int index = this.seq.getAndIncrement();
        if(index < 0) {
            this.seq.set(0);
            index = 0;
        }

        final int size = list.size();
        if (index != 0 && index >= size) {
            index = index % size;
        }

        return list.get(index);
    }
Roundrobin.

@param list the list
@return the gateway server