void (String newName) { PsiElement element = TargetElementUtil.findTargetElement(myEditor, TargetElementUtil .ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED); assertTrue(newName + " is not a valid name", RenameUtil.isValidName(myProject, element, newName)); new RenameProcessor(myProject, element, newName, false, false).run(); }