boolean (PsiMethodCallExpression call, String className, String... methodNames) { if (call == null) return false; PsiReferenceExpression methodExpression = call.getMethodExpression(); String name = methodExpression.getReferenceName(); if (!ArrayUtil.contains(name, methodNames)) return false; PsiMethod maybeMapMethod = call.resolveMethod(); if (maybeMapMethod == null || maybeMapMethod.getParameterList().getParametersCount() != call.getArgumentList().getExpressionCount()) { return false; } PsiClass containingClass = maybeMapMethod.getContainingClass(); if (containingClass == null) return false; if (className.equals(containingClass.getQualifiedName())) return true; PsiMethod[] superMethods = maybeMapMethod.findDeepestSuperMethods(); return StreamEx.of(superMethods).map(PsiMember::getContainingClass).nonNull().map(PsiClass::getQualifiedName).has(className); }