void (@NotNull Project project, @NotNull ProblemDescriptor descriptor) { final PsiClass psiClass = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), PsiClass.class); if (psiClass == null || !TestNGUtil.checkTestNGInClasspath(psiClass)) return; if (!FileModificationService.getInstance().preparePsiElementsForWrite(psiClass)) return; WriteAction.run(() -> doFix(project, psiClass)); }