void (final String... conflicts) { final MultiMap<PsiElement, String> conflictsMap = new MultiMap<>(); doTest(() -> { final PsiClass srcClass = myFixture.findClass("a.A"); assertNotNull("Source class not found", srcClass); final PsiClass targetClass = myFixture.findClass("b.B"); assertNotNull("Target class not found", targetClass); final PsiMethod[] methods = srcClass.getMethods(); assertTrue("No methods found", methods.length > 0); final MemberInfo[] membersToMove = new MemberInfo[1]; final MemberInfo memberInfo = new MemberInfo(methods[0]); memberInfo.setChecked(true); membersToMove[0] = memberInfo; final PsiDirectory targetDirectory = targetClass.getContainingFile().getContainingDirectory(); final PsiPackage targetPackage = targetDirectory != null ? JavaDirectoryService.getInstance().getPackage(targetDirectory) : null; conflictsMap.putAllValues( PullUpConflictsUtil.checkConflicts(membersToMove, srcClass, targetClass, targetPackage, targetDirectory, psiMethod -> PullUpProcessor.checkedInterfacesContain(Arrays.asList(membersToMove), psiMethod))); new PullUpProcessor(srcClass, targetClass, membersToMove, new DocCommentPolicy<>(DocCommentPolicy.ASIS)).run(); }); if (conflicts.length != 0 && conflictsMap.isEmpty()) { fail("Conflict was not detected"); } final HashSet<String> values = new HashSet<>(conflictsMap.values()); final HashSet<String> expected = new HashSet<>(Arrays.asList(conflicts)); assertEquals(expected.size(), values.size()); for (String value : values) { if (!expected.contains(value)) { fail("Conflict: " + value + " is unexpectedly reported"); } } }