@Test
  public void testRoundRobinAssignment() throws Exception {
    List<ServerName> onlineServers = new ArrayList<ServerName>(servers.size());
    onlineServers.addAll(servers);
    List<RegionInfo> regions = randomRegions(25);
    int bogusRegion = 0;
    for (RegionInfo region : regions) {
      String group =
        tableDescs.get(region.getTable()).getRegionServerGroup().orElse(RSGroupInfo.DEFAULT_GROUP);
      if ("dg3".equals(group) || "dg4".equals(group)) {
        bogusRegion++;
      }
    }
    Set<Address> offlineServers = new HashSet<Address>();
    offlineServers.addAll(groupMap.get("dg3").getServers());
    offlineServers.addAll(groupMap.get("dg4").getServers());
    for (Iterator<ServerName> it = onlineServers.iterator(); it.hasNext();) {
      ServerName server = it.next();
      Address address = server.getAddress();
      if (offlineServers.contains(address)) {
        it.remove();
      }
    }
    Map<ServerName, List<RegionInfo>> assignments =
      loadBalancer.roundRobinAssignment(regions, onlineServers);
    assertEquals(bogusRegion, assignments.get(LoadBalancer.BOGUS_SERVER_NAME).size());
  }
Test BOGUS_SERVER_NAME among groups do not overwrite each other.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestRSGroupBasedLoadBalancer.java