boolean (PsiElement psiElement) { final Project project = psiElement.getProject(); final PsiManager manager = PsiManager.getInstance(project); if (JavaPsiFacade.getInstance(manager.getProject()).findClass(TestNG.class.getName(), psiElement.getResolveScope()) == null) { if (!ApplicationManager.getApplication().isUnitTestMode()) { if (Messages.showOkCancelDialog(psiElement.getProject(), TestngBundle.message("testng.util.will.be.added.to.module.classpath"), TestngBundle.message("testng.util.unable.to.convert"), Messages.getWarningIcon()) != Messages.OK) { return false; } } final Module module = ModuleUtilCore.findModuleForPsiElement(psiElement); if (module == null) return false; String url = VfsUtil.getUrlForLibraryRoot(new File(PathUtil.getJarPathForClass(Assert.class))); ModuleRootModificationUtil.addModuleLibrary(module, url); } return true; }