@Test
  public void testUpdate() throws Exception {
    ServerName activeMasterServerName = REGISTRY.getActiveMaster().get();
    ServerName masterInConf = ServerName.valueOf(activeMasterServerName.getHostname(),
      activeMasterServerName.getPort(), -1);
    // we should have master in the beginning
    assertThat(REGISTRY.getParsedServers(), hasItem(masterInConf));
    // and after refreshing, we will switch to use region servers
    UTIL.waitFor(15000, () -> !REGISTRY.getParsedServers().contains(masterInConf)
      && !REGISTRY.getParsedServers().contains(activeMasterServerName));
    Set<ServerName> parsedServers = REGISTRY.getParsedServers();
    assertEquals(2, parsedServers.size());
    // now kill one region server
    ServerName serverToKill = parsedServers.iterator().next();
    UTIL.getMiniHBaseCluster().killRegionServer(serverToKill);
    // wait until the region server disappears
    // since the min node limit is 2, this means region server will still contact each other for
    // getting bootstrap nodes, instead of requesting master directly, so this assert can make sure
    // that the getAllBootstrapNodes works fine, and also the client can communicate with region
    // server to update bootstrap nodes
    UTIL.waitFor(30000, () -> !REGISTRY.getParsedServers().contains(serverToKill));
    // should still have 2 servers, the remaining 2 live region servers
    assertEquals(2, parsedServers.size());
    // make sure the registry still works fine
    assertNotNull(REGISTRY.getClusterId().get());
  }
Make sure that we can update the bootstrap server from master to region server, and region server
could also contact each other to update the bootstrap nodes.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestBootstrapNodeUpdate.java