void (@NotNull PsiMethodCallExpression call) { if (!INFINITE_SOURCE.test(call)) return; PsiMethodCallExpression allConsumingCall = findSubsequentCall(call, name -> ALL_CONSUMING_OPERATIONS.contains(name), name -> NON_LIMITING_OPERATIONS.contains(name)); if (allConsumingCall == null) return; PsiElement nameElement = allConsumingCall.getMethodExpression().getReferenceNameElement(); if (nameElement == null) return; holder.registerProblem(nameElement, JavaBundle.message("inspection.endless.stream.description")); }