boolean (final PsiClass psiClass) { return ReadAction.compute(() -> { if (!ConfigurationUtil.PUBLIC_INSTANTIATABLE_CLASS.value(psiClass)) return false; //PsiManager manager = PsiManager.getInstance(project); //if(manager.getEffectiveLanguageLevel().compareTo(LanguageLevel.JDK_1_5) < 0) return true; boolean hasTest = TestNGUtil.hasTest(psiClass); if (hasTest) { if (checkClassCanBeInstantiated) { final PsiMethod[] constructors = psiClass.getConstructors(); if (constructors.length > 0) { boolean canBeInstantiated = false; for (PsiMethod constructor : constructors) { PsiParameter[] parameters = constructor.getParameterList().getParameters(); if (parameters.length == 0 || AnnotationUtil.isAnnotated(constructor, INJECTION_ANNOTATIONS, AnnotationUtil.CHECK_HIERARCHY) || parameters.length == 1 && parameters[0].getType().equalsToText(CommonClassNames.JAVA_LANG_STRING)) { canBeInstantiated = true; break; } } if (!canBeInstantiated && !AnnotationUtil.isAnnotated(psiClass, GUICE, 0)) { return false; } } } return true; } return includeConfig && TestNGUtil.hasConfig(psiClass, TestNGUtil.CONFIG_ANNOTATIONS_FQN_NO_TEST_LEVEL); }); }