void (PsiAnnotationMemberValue annotationMemberValue, PsiMethod method, List<PsiClassType> exceptionsThrown) { if (!(annotationMemberValue instanceof PsiClassObjectAccessExpression classObjectAccessExpression)) { return; } final PsiTypeElement operand = classObjectAccessExpression.getOperand(); final PsiType type = operand.getType(); if (!(type instanceof PsiClassType expectedType)) { return; } if (InheritanceUtil.isInheritor(expectedType, CommonClassNames.JAVA_LANG_RUNTIME_EXCEPTION)) { return; } for (PsiClassType exceptionType : exceptionsThrown) { if (exceptionType.isAssignableFrom(expectedType)) { return; } } myProblemsHolder.registerProblem(operand, TestngBundle.message("inspection.testng.expected.exception.never.thrown.problem", method.getName())); }