void (boolean isTargetParameter, final int targetIndex, final String newVisibility) { final String filePath = "/refactoring/moveInstanceMethod/" + getTestName(false) + ".java"; configureByFile(filePath); final PsiElement targetElement = TargetElementUtil.findTargetElement(getEditor(), TargetElementUtil.ELEMENT_NAME_ACCEPTED); assertTrue("<caret> is not on method name", targetElement instanceof PsiMethod); PsiMethod method = (PsiMethod) targetElement; final PsiVariable targetVariable = isTargetParameter ? method.getParameterList().getParameters()[targetIndex] : method.getContainingClass().getFields()[targetIndex]; new MoveInstanceMethodProcessor(getProject(), method, targetVariable, newVisibility, MoveInstanceMethodHandler.suggestParameterNames (method, targetVariable)).run(); checkResultByFile(filePath + ".after"); }