void (PsiReferenceList beforeThrows, PsiReferenceList afterThrows, PsiMethod psiMethod) { PsiClassType[] beforeTypes = beforeThrows.getReferencedTypes(); PsiClassType[] afterTypes = afterThrows.getReferencedTypes(); assertEquals("Throws counts are different for Method :" + psiMethod.getName(), beforeTypes.length, afterTypes.length); for (PsiClassType beforeType : beforeTypes) { boolean found = false; for (PsiClassType afterType : afterTypes) { if (beforeType.equals(afterType)) { found = true; break; } } assertTrue("Expected throw: " + beforeType.getClassName() + " not found on " + psiMethod.getName(), found); } }