void (final String conflict) { doTest(() -> { PsiClass aClass = myFixture.findClass("Test"); final PsiField field = aClass.findFieldByName("myField", false); final Set<PsiMethod> methods = DelegationUtils.getDelegatingMethodsForField(field); List<MemberInfo> infos = new ArrayList<>(); for (PsiMethod method : methods) { final MemberInfo info = new MemberInfo(method); info.setChecked(true); info.setToAbstract(true); infos.add(info); } try { RemoveMiddlemanProcessor processor = new RemoveMiddlemanProcessor(field, infos); processor.run(); if (conflict != null) TestCase.fail("Conflict expected"); } catch (BaseRefactoringProcessor.ConflictsInTestsException e) { if (conflict == null) throw e; TestCase.assertEquals(conflict, e.getMessage()); } }); }