public synchronized Hosts putAllInRandomOrder(String domain, String[] ips) {
        Random random = new Random();
        int index = (int) (random.nextLong() % ips.length);
        if (index < 0) {
            index += ips.length;
        }
        LinkedList<String> ipList = new LinkedList<String>();
        for (int i = 0; i < ips.length; i++) {
            ipList.add(ips[(i + index) % ips.length]);
        }
        hosts.put(domain, ipList);
        return this;
    }
public synchronized Hosts putAllInRandomOrder ( String domain , String [ ] ips ) { Random random = new Random ( ) ; int index = ( int ) ( random . nextLong ( ) % ips . length ) ; if ( index < 0 ) { index += ips . length ; } LinkedList < String > ipList = new LinkedList < String > ( ) ; for ( int i = 0 ; i < ips . length ; i ++ ) { ipList . add ( ips [ ( i + index ) % ips . length ] ) ; } hosts . put ( domain , ipList ) ; return this ; }
avoid many server visit first ip in same time.s

@param domain 域名
@param ips    IP 列表
@return 当前host 实例