boolean (Class<?> testCaseClass, String moduleName, boolean checkForExclusion) { if ((testCaseClass.getModifiers() & Modifier.ABSTRACT) != 0) return false; if (checkForExclusion) { if (shouldExcludeTestClass(moduleName, testCaseClass)) return false; boolean isHardwareAgentRequired = getAnnotationInHierarchy(testCaseClass, HardwareAgentRequired.class) != null; if (isHardwareAgentRequired != HARDWARE_AGENT_REQUIRED) return false; } if (TestCase.class.isAssignableFrom(testCaseClass) || TestSuite.class.isAssignableFrom(testCaseClass)) { return true; } try { final Method suiteMethod = testCaseClass.getMethod("suite"); if (Test.class.isAssignableFrom(suiteMethod.getReturnType()) && (suiteMethod.getModifiers() & Modifier.STATIC) != 0) { return true; } } catch (NoSuchMethodException ignored) { } return TestFrameworkUtil.isJUnit4TestClass(testCaseClass, false) || TestFrameworkUtil.isJUnit5TestClass(testCaseClass, false); }