private void loadAndValidateHFileReplication(String testName, int masterNumber,
    int[] slaveNumbers, byte[] row, byte[] fam, Table[] tables, byte[][][] hfileRanges,
    int numOfRows, int[] expectedCounts, boolean toValidate) throws Exception {
    HBaseTestingUtil util = utilities[masterNumber];

    Path dir = util.getDataTestDirOnTestFS(testName);
    FileSystem fs = util.getTestFileSystem();
    dir = dir.makeQualified(fs.getUri(), fs.getWorkingDirectory());
    Path familyDir = new Path(dir, Bytes.toString(fam));

    int hfileIdx = 0;
    for (byte[][] range : hfileRanges) {
      byte[] from = range[0];
      byte[] to = range[1];
      HFileTestUtil.createHFile(util.getConfiguration(), fs,
        new Path(familyDir, "hfile_" + hfileIdx++), fam, row, from, to, numOfRows);
    }

    Table source = tables[masterNumber];
    final TableName tableName = source.getName();
    BulkLoadHFiles.create(util.getConfiguration()).bulkLoad(tableName, dir);

    if (toValidate) {
      for (int slaveClusterNumber : slaveNumbers) {
        wait(slaveClusterNumber, tables[slaveClusterNumber], expectedCounts[slaveClusterNumber]);
      }
    }
  }
Tests that base replication peer configs are applied on peer creation and the configs are
overriden if updated as part of updateReplicationPeerConfig()
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java