void () { String name = getTestName(false); @NonNls String fileName = "/refactoring/inlineConstantField/" + name + ".java"; configureByFile(fileName); PsiElement element = TargetElementUtil .findTargetElement(getEditor(), TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED); final PsiReference ref = getFile().findReferenceAt(getEditor().getCaretModel().getOffset()); PsiReferenceExpression refExpr = ref instanceof PsiReferenceExpression ? (PsiReferenceExpression)ref : null; assertTrue(element instanceof PsiField); PsiField field = (PsiField)element.getNavigationElement(); new InlineConstantFieldProcessor(field, getProject(), refExpr, true).run(); checkResultByFile(fileName + ".after"); }