protected static Map<String, RSGroupInfo> constructGroupInfo(List<ServerName> servers,
    String[] groups) {
    assertTrue(servers != null);
    assertTrue(servers.size() >= groups.length);
    int index = 0;
    Map<String, RSGroupInfo> groupMap = new HashMap<>();
    for (String grpName : groups) {
      RSGroupInfo RSGroupInfo = new RSGroupInfo(grpName);
      RSGroupInfo.addServer(servers.get(index).getAddress());
      groupMap.put(grpName, RSGroupInfo);
      index++;
    }
    Random rand = ThreadLocalRandom.current();
    while (index < servers.size()) {
      int grpIndex = rand.nextInt(groups.length);
      groupMap.get(groups[grpIndex]).addServer(servers.get(index).getAddress());
      index++;
    }
    return groupMap;
  }
Construct group info, with each group having at least one server.
@param servers the servers
@param groups  the groups
@return the map
hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/RSGroupableBalancerTestBase.java