@Test
  public void testShutdown() throws Exception {
    TEST_UTIL.getMiniHBaseCluster().getMasterThreads().forEach(thread -> {
      assertFalse(thread.getMaster().isStopped());
    });
    TEST_UTIL.getMiniHBaseCluster().getRegionServerThreads().forEach(thread -> {
      assertFalse(thread.getRegionServer().isStopped());
    });

    admin.shutdown().join();
    TEST_UTIL.getMiniHBaseCluster().getMasterThreads().forEach(thread -> {
      while (!thread.getMaster().isStopped()) {
        trySleep(100, TimeUnit.MILLISECONDS);
      }
    });
    TEST_UTIL.getMiniHBaseCluster().getRegionServerThreads().forEach(thread -> {
      while (!thread.getRegionServer().isStopped()) {
        trySleep(100, TimeUnit.MILLISECONDS);
      }
    });
  }
Only used to test stopMaster/stopRegionServer/shutdown methods.
hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAsyncClusterAdminApi2.java