boolean (@NotNull CFGBuilder builder, @NotNull PsiMethodCallExpression call) { PsiExpression qualifier = PsiUtil.skipParenthesizedExprDown(call.getMethodExpression().getQualifierExpression()); if (qualifier == null) return false; JavaResolveResult result = call.getMethodExpression().advancedResolve(false); PsiMethod method = (PsiMethod)result.getElement(); if (method == null || method != LambdaUtil.getFunctionalInterfaceMethod(method.getContainingClass())) return false; if (method.isVarArgs()) return false; // TODO: support varargs PsiExpression[] args = call.getArgumentList().getExpressions(); PsiParameter[] parameters = method.getParameterList().getParameters(); if (args.length != parameters.length) return false; PsiSubstitutor substitutor = result.getSubstitutor(); return builder.tryInlineLambda(args.length, qualifier, DfaPsiUtil.getTypeNullability(substitutor.substitute(method.getReturnType())), () -> EntryStream.zip(args, parameters) .forKeyValue((arg, parameter) -> builder.pushExpression(arg).boxUnbox(arg, parameter.getType()))); }