PsiElementVisitor (@NotNull ProblemsHolder holder, boolean isOnTheFly) { if (!PsiUtil.isLanguageLevel8OrHigher(holder.getFile())) { return PsiElementVisitor.EMPTY_VISITOR; } return new JavaElementVisitor() { @Override public void visitMethodCallExpression(@NotNull PsiMethodCallExpression call) { for(LambdaAndExplicitMethodPair info : LambdaAndExplicitMethodPair.INFOS) { PsiExpression arg = info.getLambdaCandidateFromExplicitCall(call); if(arg != null && !(arg instanceof PsiEmptyExpressionImpl) && !ExpressionUtils.isSafelyRecomputableExpression(arg)) { holder.registerProblem(arg, JavaBundle.message("inspection.explicit.argument.can.be.lambda.message"), new ConvertExplicitCallToLambdaFix(info, info.getLambdaMethodName(call))); return; } } } }; }