@Override
  public void testStarted(Description description) throws Exception {
    Category[] categories = description.getTestClass().getAnnotationsByType(Category.class);

    // @Category is not repeatable -- it is only possible to get an array of length zero or one.
    if (categories.length == 1) {
      for (Class<?> c : categories[0].value()) {
        if (c == IntegrationTests.class) {
          return;
        }
      }
    }
    for (Field field : description.getTestClass().getFields()) {
      if (
        Modifier.isStatic(field.getModifiers()) && field.getType() == HBaseClassTestRule.class
          && field.isAnnotationPresent(ClassRule.class)
      ) {
        HBaseClassTestRule timeout = (HBaseClassTestRule) field.get(null);
        assertEquals("The HBaseClassTestRule ClassRule in " + description.getTestClass().getName()
          + " is for " + timeout.getClazz().getName(), description.getTestClass(),
          timeout.getClazz());
        return;
      }
    }
    fail("No HBaseClassTestRule ClassRule for " + description.getTestClass().getName());
  }
A RunListener to confirm that we have a {@link HBaseClassTestRule} class rule for every test.
hbase-common/src/test/java/org/apache/hadoop/hbase/HBaseClassTestRuleChecker.java