boolean (PsiElement element) { if (!(element instanceof PsiMethodCallExpression expression)) { return false; } final PsiExpressionList args = expression.getArgumentList(); final int numExpressions = args.getExpressionCount(); if (numExpressions < 1 || numExpressions > 2) { return false; } final PsiReferenceExpression methodExpression = expression.getMethodExpression(); @NonNls final String methodName = methodExpression.getReferenceName(); if (!"assertTrue".equals(methodName) && !"assertFalse".equals(methodName) && !"assertNull".equals(methodName)) { return false; } final PsiMethod method = expression.resolveMethod(); if (method == null) { return false; } final PsiClass targetClass = method.getContainingClass(); if (targetClass == null) { return false; } final String qualifiedName = targetClass.getQualifiedName(); if (!"junit.framework.Assert".equals(qualifiedName) && !"org.junit.Assert".equals(qualifiedName) && !"org.junit.jupiter.api.Assertions".equals(qualifiedName)) { return false; } return !ErrorUtil.containsError(element); }