void (final int targetParameter, final String visibility) { final String filePath = getBasePath() + 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; new ConvertToInstanceMethodProcessor(getProject(), method, targetParameter < 0 ? null : method.getParameterList().getParameters()[targetParameter], visibility).run(); checkResultByFile(filePath + ".after"); }