@Test
  public void testRegistryRPCs() throws Exception {
    Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
    HMaster activeMaster = TEST_UTIL.getHBaseCluster().getMaster();
    final int size = activeMaster.getMetaLocations().size();
    for (int numHedgedReqs = 1; numHedgedReqs <= size; numHedgedReqs++) {
      conf.setInt(MasterRegistry.MASTER_REGISTRY_HEDGED_REQS_FANOUT_KEY, numHedgedReqs);
      try (MasterRegistry registry = new MasterRegistry(conf, User.getCurrent())) {
        // Add wait on all replicas being assigned before proceeding w/ test. Failed on occasion
        // because not all replicas had made it up before test started.
        RegionReplicaTestHelper.waitUntilAllMetaReplicasAreReady(TEST_UTIL, registry);
        assertEquals(registry.getClusterId().get(), activeMaster.getClusterId());
        assertEquals(registry.getActiveMaster().get(), activeMaster.getServerName());
        List<HRegionLocation> metaLocations =
          Arrays.asList(registry.getMetaRegionLocations().get().getRegionLocations());
        List<HRegionLocation> actualMetaLocations = activeMaster.getMetaLocations();
        Collections.sort(metaLocations);
        Collections.sort(actualMetaLocations);
        assertEquals(actualMetaLocations, metaLocations);
      }
    }
  }
Makes sure the master registry parses the master end points in the configuration correctly.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestMasterRegistry.java