void (@NotNull PsiMethodCallExpression call) { if (!ITERABLE_FOR_EACH.test(call)) return; PsiExpression qualifier = PsiUtil.skipParenthesizedExprDown(call.getMethodExpression().getQualifierExpression()); PsiExpression expression = getIteratedExpression(qualifier); PsiReferenceExpression mapExpression = getMapReferenceFromKeySetCall(expression); if (mapExpression == null) return; PsiExpression arg = PsiUtil.skipParenthesizedExprDown(call.getArgumentList().getExpressions()[0]); PsiLambdaExpression lambda = tryCast(arg, PsiLambdaExpression.class); if (lambda == null) return; PsiParameter[] parameters = lambda.getParameterList().getParameters(); if (parameters.length != 1) return; PsiElement body = lambda.getBody(); if (body == null) return; PsiParameter key = parameters[0]; final GetValueFromMapChecker checker = new GetValueFromMapChecker(mapExpression, key); body.accept(checker); if (!checker.isGetValueFromMap()) return; registerError(qualifier, ReplacementMode.FOR_EACH); }