void (@NotNull PsiMethodCallExpression call) { if (!ITERABLE_FOREACH.test(call)) return; PsiMethodCallExpression qualifierCall = MethodCallUtils.getQualifierMethodCall(call); if (!MAP_ENTRY_SET.test(qualifierCall)) return; PsiLambdaExpression lambda = ObjectUtils.tryCast(call.getArgumentList().getExpressions()[0], PsiLambdaExpression.class); if (lambda == null) return; PsiParameter[] lambdaParameters = lambda.getParameterList().getParameters(); if (lambdaParameters.length != 1) return; PsiParameter entry = lambdaParameters[0]; if (!allUsagesAllowed(entry)) return; PsiElement nameElement = Objects.requireNonNull(call.getMethodExpression().getReferenceNameElement()); holder.registerProblem(nameElement, JavaAnalysisBundle.message("inspection.can.be.replaced.with.message", "Map.forEach()"), new ReplaceWithMapForEachFix()); }