public static @Nullable String createLambdaParameterListWithFormalTypes(PsiType functionalInterfaceType,
                                                                          PsiLambdaExpression lambdaExpression,
                                                                          boolean checkApplicability) {
    final PsiClassType.ClassResolveResult resolveResult = PsiUtil.resolveGenericsClassInType(functionalInterfaceType);
    final StringBuilder buf = new StringBuilder();
    buf.append("(");
    final PsiMethod interfaceMethod = getFunctionalInterfaceMethod(functionalInterfaceType);
    if (interfaceMethod == null) return null;
    final PsiParameter[] parameters = interfaceMethod.getParameterList().getParameters();
    final PsiParameter[] lambdaParameters = lambdaExpression.getParameterList().getParameters();
    if (parameters.length != lambdaParameters.length) return null;
    final PsiSubstitutor substitutor = getSubstitutor(interfaceMethod, resolveResult);
    for (int i = 0; i < parameters.length; i++) {
      PsiParameter lambdaParameter = lambdaParameters[i];
      PsiTypeElement origTypeElement = lambdaParameter.getTypeElement();

      PsiType psiType;
      if (origTypeElement != null && !origTypeElement.isInferredType()) {
        psiType = origTypeElement.getType();
      } else {
        psiType = substitutor.substitute(parameters[i].getType());
        if (!PsiTypesUtil.isDenotableType(psiType, lambdaExpression)) return null;
      }

      PsiAnnotation[] annotations = lambdaParameter.getAnnotations();
      for (PsiAnnotation annotation : annotations) {
        if (AnnotationTargetUtil.isTypeAnnotation(annotation)) continue;
        buf.append(annotation.getText()).append(' ');
      }
      buf.append(checkApplicability ? psiType.getPresentableText(true) : psiType.getCanonicalText(true))
        .append(" ")
        .append(lambdaParameter.getName());
      if (i < parameters.length - 1) {
        buf.append(", ");
      }
    }
    buf.append(")");
    return buf.toString();
  }
public static @Nullable String createLambdaParameterListWithFormalTypes(PsiType functionalInterfaceType,
                                                                          PsiLambdaExpression lambdaExpression,
                                                                          boolean checkApplicability)