@Test
  public void testMergeRegionsInvalidRegionCount()
    throws IOException, InterruptedException, ExecutionException {
    TableName tableName = TableName.valueOf(name.getMethodName());
    TableDescriptor td = TableDescriptorBuilder.newBuilder(tableName)
      .setColumnFamily(ColumnFamilyDescriptorBuilder.of("d")).build();
    byte[][] splitRows = new byte[2][];
    splitRows[0] = new byte[] { (byte) '3' };
    splitRows[1] = new byte[] { (byte) '6' };
    try {
      TEST_UTIL.createTable(td, splitRows);
      TEST_UTIL.waitTableAvailable(tableName);

      List<RegionInfo> tableRegions = ADMIN.getRegions(tableName);
      // 0
      try {
        FutureUtils.get(ADMIN.mergeRegionsAsync(new byte[0][0], false));
        fail();
      } catch (IllegalArgumentException e) {
        // expected
      }
      // 1
      try {
        FutureUtils.get(ADMIN
          .mergeRegionsAsync(new byte[][] { tableRegions.get(0).getEncodedNameAsBytes() }, false));
        fail();
      } catch (IllegalArgumentException e) {
        // expected
      }
    } finally {
      ADMIN.disableTable(tableName);
      ADMIN.deleteTable(tableName);
    }
  }
Test DFS replication for column families, where one CF has default replication(3) and the other
is set to 1.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin1.java