boolean (PsiReferenceExpression ref) { if (!mySimpleName.equals(ref.getReferenceName())) return false; PsiElement element = ref.resolve(); if (!(element instanceof PsiMethod method)) return false; PsiParameterList parameters = method.getParameterList(); if (parameters.getParametersCount() != getSimpleParametersCount()) return false; if (getSimpleParametersCount() == 1) { PsiParameter parameter = Objects.requireNonNull(parameters.getParameter(0)); PsiClass parameterClass = PsiUtil.resolveClassInClassTypeOnly(parameter.getType()); if (parameterClass == null || JAVA_LANG_ITERABLE.equals(parameterClass.getQualifiedName()) || JAVA_UTIL_COLLECTION.equals(parameterClass.getQualifiedName())) { return false; } } PsiClass methodClass = method.getContainingClass(); if (methodClass == null || !InheritanceUtil.isInheritor(methodClass, myClassName)) return false; return haveBulkMethod(methodClass); }