void (@NotNull final Project project, @NotNull ProblemDescriptor descriptor) { final PsiClass psiClass = PsiTreeUtil.getParentOfType(descriptor.getPsiElement(), PsiClass.class); LOG.assertTrue(psiClass != null); final String testngXmlPath = new SuiteBrowser(project).showDialog(); if (testngXmlPath == null) return; final VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByPath(testngXmlPath); LOG.assertTrue(virtualFile != null); final PsiFile psiFile = PsiManager.getInstance(project).findFile(virtualFile); LOG.assertTrue(psiFile instanceof XmlFile); final XmlFile testngXML = (XmlFile)psiFile; WriteCommandAction.writeCommandAction(project, testngXML).withName(getName()).run(() -> patchTestngXml(testngXML, psiClass)); }