void (@NotNull PsiMethodCallExpression call) { super.visitMethodCallExpression(call); PsiReferenceExpression expression = call.getMethodExpression(); PsiElement nameElement = expression.getReferenceNameElement(); if (nameElement == null || !SUPPORTED_TERMINALS.contains(nameElement.getText())) return; if (!CodeBlockSurrounder.canSurround(call)) return; PsiMethod method = call.resolveMethod(); if(method == null) return; PsiClass aClass = method.getContainingClass(); if (InheritanceUtil.isInheritor(aClass, CommonClassNames.JAVA_UTIL_STREAM_BASE_STREAM)) { if (extractOperations(ChainVariable.STUB, call, SUPPORT_UNKNOWN_SOURCES) != null) { register(call, nameElement, JavaBundle.message("stream.to.loop.inspection.message.replace.stream.api.chain.with.loop")); } } else if (extractIterableForEach(call) != null || extractMapForEach(call) != null) { register(call, nameElement, JavaBundle.message("stream.to.loop.inspection.message.replace.foreach.call.with.loop")); } }