boolean (@NotNull Class<?> aClass, boolean allowAbstract) { int modifiers = aClass.getModifiers(); if (!allowAbstract && (modifiers & Modifier.ABSTRACT) != 0) return false; if ((modifiers & Modifier.PUBLIC) == 0) return false; if (aClass.getAnnotation(ExtendWith.class) != null) return true; for (Method method : aClass.getMethods()) { if (method.getAnnotation(org.junit.jupiter.api.Test.class) != null) return true; } return false; }