private boolean isTestClass(Class<?> c) {
      if (Modifier.isAbstract(c.getModifiers())) {
        return false;
      }

      if (c.getAnnotation(Suite.SuiteClasses.class) != null) {
        return true;
      }

      for (Method met : c.getMethods()) {
        if (met.getAnnotation(Test.class) != null) {
          return true;
        }
      }

      return false;
    }
Filters both test classes and anything in the hadoop-compat modules
hbase-common/src/test/java/org/apache/hadoop/hbase/ClassTestFinder.java