@Test
  public void testKillMiniHBaseCluster() throws Exception {

    HBaseTestingUtil htu = new HBaseTestingUtil();
    htu.startMiniZKCluster();

    try {
      htu.startMiniHBaseCluster();

      TableName tableName;
      byte[] FAM_NAME;

      for (int i = 0; i < NUMTABLES; i++) {
        tableName = TableName.valueOf(name.getMethodName() + i);
        FAM_NAME = Bytes.toBytes("fam" + i);

        try (Table table = htu.createMultiRegionTable(tableName, FAM_NAME, NUMREGIONS)) {
          htu.loadRandomRows(table, FAM_NAME, 100, NUMROWS);
        }
      }
    } finally {
      htu.killMiniHBaseCluster();
      htu.shutdownMiniZKCluster();
    }
  }
Test that we can start and stop multiple time a cluster with the same HBaseTestingUtility.
hbase-server/src/test/java/org/apache/hadoop/hbase/TestHBaseTestingUtil.java