public static @NotNull List<Pair<PsiParameter, PsiType>> collectExpectedParamsByArg(@NotNull PsiElement place,
                                                                                      GroovyResolveResult @NotNull [] variants,
                                                                                      GrNamedArgument @NotNull [] namedArguments,
                                                                                      GrExpression @NotNull [] expressionArguments,
                                                                                      GrClosableBlock @NotNull [] closureArguments,
                                                                                      @NotNull GrExpression arg) {
    List<Pair<PsiParameter, PsiType>> expectedParams = new ArrayList<>();

    for (GroovyResolveResult variant : variants) {
      if (variant instanceof GroovyMethodResult && ((GroovyMethodResult)variant).getCandidate() != null) {
        GroovyMethodCandidate candidate = ((GroovyMethodResult)variant).getCandidate();
        if (candidate != null) {
          ArgumentMapping<PsiCallParameter> mapping = candidate.getArgumentMapping();
          if (mapping != null) {
            Argument argument = new ExpressionArgument(arg);
            PsiCallParameter obj = mapping.targetParameter(argument);
            PsiParameter targetParameter = obj == null ? null : obj.getPsi();
            PsiType expectedType = mapping.expectedType(argument);
            ContainerUtil.addIfNotNull(expectedParams, Pair.create(targetParameter, expectedType));
          }
        }
      }
      else {
        final Map<GrExpression, Pair<PsiParameter, PsiType>> map = GrClosureSignatureUtil.mapArgumentsToParameters(
          variant, place, true, true, namedArguments, expressionArguments, closureArguments
        );

        if (map != null) {
          final Pair<PsiParameter, PsiType> pair = map.get(arg);
          ContainerUtil.addIfNotNull(expectedParams, pair);
        }
      }
    }
    return expectedParams;
  }
public static @NotNull List<Pair<PsiParameter, PsiType>> collectExpectedParamsByArg(@NotNull PsiElement place,
                                                                                      GroovyResolveResult @NotNull [] variants,
                                                                                      GrNamedArgument @NotNull [] namedArguments,
                                                                                      GrExpression @NotNull [] expressionArguments,
                                                                                      GrClosableBlock @NotNull [] closureArguments,
                                                                                      @NotNull GrExpression arg)