void () { configureByFile(BASE_PATH + getTestName(false) + ".java"); PsiLocalVariable local = PsiTreeUtil.getParentOfType(getFile().findElementAt(getEditor().getCaretModel().getOffset()), PsiLocalVariable.class); new MockLocalToFieldHandler(getProject(), true, false){ @Override protected int getChosenClassIndex(List<PsiClass> classes) { return 0; } } .convertLocalToField(local, getEditor()); checkResultByFile(BASE_PATH + getTestName(false) + "_after.java"); }