void (final String expectedMessage) { configureByFile("/refactoring/inlineToAnonymousClass/" + getTestName(false) + ".java"); PsiElement element = TargetElementUtil.findTargetElement(getEditor(), TargetElementUtil .ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED); assertInstanceOf(element, PsiClass.class); final PsiClass psiClass = (PsiClass)element; assertEquals(expectedMessage, InlineToAnonymousClassHandler.getCannotInlineMessage(psiClass)); }