void (String conflicts, boolean extractInnerClass, RefactoringTestUtil.MemberDescriptor... memberDescriptors) { doTest(() -> { final PsiClass aClass = myFixture.findClass("Test"); assertNotNull("Class Test not found", aClass); final ArrayList<PsiField> fields = new ArrayList<>(); final ArrayList<PsiMethod> methods = new ArrayList<>(); final List<MemberInfo> enumConstants = new ArrayList<>(); for (MemberInfo memberInfo : RefactoringTestUtil.findMembers(aClass, memberDescriptors)) { final PsiMember member = memberInfo.getMember(); if (member instanceof PsiField) { fields.add((PsiField)member); if (member.hasModifierProperty(PsiModifier.STATIC) && member.hasModifierProperty(PsiModifier.FINAL) && ((PsiField)member).hasInitializer()) { if (memberInfo.isToAbstract()) { enumConstants.add(memberInfo); memberInfo.setChecked(true); } } } else if (member instanceof PsiMethod) { methods.add((PsiMethod)member); } } try { final ExtractClassProcessor processor = new ExtractClassProcessor(aClass, fields, methods, new ArrayList<>(), "", null, "EEnum", null, false, enumConstants, extractInnerClass); processor.run(); LocalFileSystem.getInstance().refresh(false); FileDocumentManager.getInstance().saveAllDocuments(); } catch (BaseRefactoringProcessor.ConflictsInTestsException e) { if (conflicts != null) { TreeSet<String> expectedConflictsSet = new TreeSet<>(Arrays.asList(conflicts.split("\n"))); TreeSet<String> actualConflictsSet = new TreeSet<>(Arrays.asList(e.getMessage().split("\n"))); Assert.assertEquals(expectedConflictsSet, actualConflictsSet); return; } else { fail(e.getMessage()); } } if (conflicts != null) { fail("Conflicts were not detected: " + conflicts); } }); }