void (PsiClass beforeClass, PsiClass afterClass) { PsiMethod[] beforeConstructors = beforeClass.getConstructors(); PsiMethod[] afterConstructors = afterClass.getConstructors(); LOG.debug("IntelliJ constructors for class " + beforeClass.getName() + ": " + Arrays.toString(beforeConstructors)); LOG.debug("Theirs constructors for class " + afterClass.getName() + ": " + Arrays.toString(afterConstructors)); assertEquals("Constructor counts are different for Class: " + beforeClass.getName(), afterConstructors.length, beforeConstructors.length); for (PsiMethod afterConstructor : afterConstructors) { boolean compared = false; final PsiModifierList theirsFieldModifierList = afterConstructor.getModifierList(); final List<PsiType> afterConstructorParameterTypes = ContainerUtil.map(afterConstructor.getParameterList().getParameters(), PsiParameter::getType); for (PsiMethod beforeConstructor : beforeConstructors) { if (PsiElementUtil.methodMatches(beforeConstructor, null, null, afterConstructor.getName(), afterConstructorParameterTypes)) { final PsiModifierList intellijConstructorModifierList = beforeConstructor.getModifierList(); compareModifiers(intellijConstructorModifierList, theirsFieldModifierList); compared = true; break; } } assertTrue("Constructors are not equal, Constructor: '" + afterConstructor.getName() + "' (with same parameters) not found in class : " + beforeClass.getName(), compared); } }