void () { final String className="container.MyCustomContainer"; final String methodName = "setStaticProp"; final String newName = "setNewMethodName"; myFixture.configureByFiles(getTestName(true) + ".fxml", className.replace('.', '/') + ".java"); final PsiClass psiClass = myFixture.findClass(className); assertNotNull(psiClass); final PsiMethod[] methods = psiClass.findMethodsByName(methodName, false); assertEquals(1, methods.length); final PsiMethod method = methods[0]; final RenameRefactoring rename = new JavaRenameRefactoringImpl(getProject(), method, newName, false, false); rename.run(); myFixture.checkResultByFile(getTestName(true) + "_after.fxml"); assertMethodExists(psiClass, newName); }