void () { try { doTestInplaceRename("bar"); } catch (BaseRefactoringProcessor.ConflictsInTestsException e) { assertEquals("Method bar() is already defined in the class <b><code>Foo</code></b>", e.getMessage()); checkResultByFile(BASE_PATH + getTestName(false) + "_after.java"); return; } fail("Conflict was not detected"); }