public static void addServers(Properties opts) {
    String[] serverStrings = null;
    if (opts.containsKey("uris")) {
      serverStrings = ((String)opts.get("uris")).split(",");
    }
    else if (opts.containsKey("servers")) {
      serverStrings = ((String)opts.get("servers")).split(",");
    }
    else if (opts.containsKey("uri")) {
      serverStrings = ((String)opts.get("uri")).split(",");
    }

    Random rand = (((Boolean)opts.get("dont_randomize_servers"))
        == Boolean.TRUE ? null : new Random());
    String[] uri;
    for(int i = 0; i < serverStrings.length; i++) {
      int idx = i;
      for(; rand != null; ) {
        idx = rand.nextInt(serverStrings.length);
        if (serverStrings[idx] != null) { break; }
      }
      uri = serverStrings[idx].split(":");
      Server server = new Server();
      if (serverStrings[idx].contains("@")) {
        server.user = uri[1].substring(2, uri[1].length());
        server.pass = uri[2].split("@")[0];
        server.host = uri[2].split("@")[1];
        server.port = Integer.parseInt(uri[3]);
      }
      else {
        server.user = null;
        server.pass = null;
        server.host = uri[1].substring(2, uri[1].length());
        server.port = Integer.parseInt(uri[2]);
      }
      serverStrings[idx] = null;
      servers.add(server);
    }
  }