void (PsiClass beforeClass, PsiClass afterClass) { PsiField[] beforeClassFields = beforeClass.getFields(); PsiField[] afterClassFields = afterClass.getFields(); LOG.debug("IntelliJ fields for class " + beforeClass.getName() + ": " + Arrays.toString(beforeClassFields)); LOG.debug("Theirs fields for class " + afterClass.getName() + ": " + Arrays.toString(afterClassFields)); assertEquals("Field are different for Class: " + beforeClass.getName(), Arrays.toString(toList(afterClassFields)), Arrays.toString(toList(beforeClassFields))); for (PsiField afterField : afterClassFields) { boolean compared = false; final PsiModifierList afterFieldModifierList = afterField.getModifierList(); for (PsiField beforeField : beforeClassFields) { if (Objects.equal(afterField.getName(), beforeField.getName())) { final PsiModifierList beforeFieldModifierList = beforeField.getModifierList(); if (beforeFieldModifierList != null && afterFieldModifierList != null) { compareModifiers(beforeFieldModifierList, afterFieldModifierList); } compareType(beforeField.getType(), afterField.getType(), afterField); compareInitializers(beforeField.getInitializer(), afterField.getInitializer()); compared = true; } } assertTrue("Fieldnames are not equal, Field (" + afterField.getName() + ") not found", compared); } }