public JVMClusterUtil.MasterThread addMaster(Configuration c, final int index)
    throws IOException {
    // Create each master with its own Configuration instance so each has
    // its Connection instance rather than share (see HBASE_INSTANCES down in
    // the guts of ConnectionManager.
    JVMClusterUtil.MasterThread mt = JVMClusterUtil.createMasterThread(c,
      (Class<? extends HMaster>) c.getClass(HConstants.MASTER_IMPL, this.masterClass), index);
    this.masterThreads.add(mt);
    // Refresh the master address config.
    List<String> masterHostPorts = new ArrayList<>();
    getMasters().forEach(masterThread -> masterHostPorts
      .add(masterThread.getMaster().getServerName().getAddress().toString()));
    conf.set(HConstants.MASTER_ADDRS_KEY, String.join(",", masterHostPorts));
    return mt;
  }
Constructor.
@param conf            Configuration to use. Post construction has the master's address.
@param noMasters       Count of masters to start.
@param noRegionServers Count of regionservers to start.
hbase-server/src/main/java/org/apache/hadoop/hbase/LocalHBaseCluster.java