void () { try { doTest(null); fail("Refactoring should not be performed"); } catch (CommonRefactoringUtil.RefactoringErrorHintException e) { assertEquals("Cannot perform refactoring.\n" + JavaRefactoringBundle.message("introduce.variable.message.cannot.extract.in.unnamed.class"), e.getMessage()); } }