protected TableName getTableName(ServerName sn) throws IOException {
    TableName tableName = null;
    RSGroupInfoManager gm = getMockedGroupInfoManager();
    RSGroupInfo groupOfServer = null;
    for (RSGroupInfo gInfo : gm.listRSGroups()) {
      if (gInfo.containsServer(sn.getAddress())) {
        groupOfServer = gInfo;
        break;
      }
    }

    for (TableDescriptor desc : tableDescs.values()) {
      Optional<String> optGroupName = desc.getRegionServerGroup();
      if (optGroupName.isPresent() && optGroupName.get().endsWith(groupOfServer.getName())) {
        tableName = desc.getTableName();
      }
    }
    return tableName;
  }
Construct table descriptors evenly distributed between the groups.
@param hasBogusTable there is a table that does not determine the group
@return the list of table descriptors
hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/RSGroupableBalancerTestBase.java