void (boolean success, String migrationTypeText) { String dataPath = "/refactoring/changeTypeSignature/"; configureByFile(dataPath + getTestName(false) + ".java"); final PsiFile file = getFile(); final PsiElement element = file.findElementAt(getEditor().getCaretModel().getOffset()); final PsiReferenceParameterList parameterList = PsiTreeUtil.getParentOfType(element, PsiReferenceParameterList.class); assert parameterList != null; final PsiClass superClass = (PsiClass)((PsiJavaCodeReferenceElement)parameterList.getParent()).resolve(); assert superClass != null; PsiType migrationType = getJavaFacade().getElementFactory().createTypeFromText(migrationTypeText, null); try { final TypeMigrationRules rules = new TypeMigrationRules(getProject()); rules.setBoundScope(GlobalSearchScope.projectScope(getProject())); new TypeMigrationProcessor(getProject(), new PsiElement[]{parameterList}, Functions.constant(PsiSubstitutor.EMPTY.put(superClass.getTypeParameters()[0], migrationType).substitute(new PsiImmediateClassType(superClass, PsiSubstitutor.EMPTY))), rules, true).run(); if (success) { checkResultByFile(dataPath + getTestName(false) + ".java.after"); } else { fail("Conflicts should be detected"); } } catch (RuntimeException e) { if (success) { e.printStackTrace(); fail("Conflicts should not appear"); } } }