@Test
  public void testHouseKeepingThreadExistence() throws Exception {
    searchHousekeepingThreads();

    // Verify existence of threads
    for (Map.Entry<String, Boolean> entry : threadNames.entrySet()) {
      if (entry.getValue()) {
        LOG.info("Found thread with name " + entry.getKey());
      }
      Assert.assertTrue("No thread with name " + entry.getKey() + " found.", entry.getValue());
    }

    for (Map.Entry<Class<? extends Thread>, Boolean> entry : threadClasses.entrySet()) {
      if (entry.getValue()) {
        LOG.info("Found thread for " + entry.getKey().getSimpleName());
      }
      Assert.assertTrue("No thread found for class " + entry.getKey().getSimpleName(),
              entry.getValue());
    }
  }
Test for specifying empty HMS leader.
itests/hive-unit/src/test/java/org/apache/hadoop/hive/metastore/TestMetastoreHousekeepingLeaderEmptyConfig.java