private static @Nullable PsiParameter findWrongParameter(@NotNull PsiMethodCallExpression call,
                                                           @NotNull PsiMethod method,
                                                           @NotNull PsiSubstitutor substitutor, @NotNull PsiTypeParameter typeParameter) {
    PsiParameter[] parameters = method.getParameterList().getParameters();
    PsiExpression[] expressions = call.getArgumentList().getExpressions();
    if (expressions.length != parameters.length) return null;
    PsiElementFactory factory = JavaPsiFacade.getElementFactory(call.getProject());
    List<PsiParameter> candidates = new ArrayList<>();
    for (int i = 0; i < parameters.length; i++) {
      PsiType type = parameters[i].getType();
      if (!PsiTypesUtil.mentionsTypeParameters(type, Set.of(typeParameter))) continue;
      PsiType substituted = substitutor.substitute(type);
      PsiTypeCastExpression cast = (PsiTypeCastExpression)factory.createExpressionFromText("(x)null", call);
      PsiTypeElement typeElement = factory.createTypeElement(substituted);
      try {
        Objects.requireNonNull(cast.getCastType()).replace(typeElement);
      }
      catch (IncorrectOperationException ignored) {
        // Malformed type
        continue;
      }
      PsiMethodCallExpression copy = (PsiMethodCallExpression)LambdaUtil.copyTopLevelCall(call);
      copy.getArgumentList().getExpressions()[i].replace(cast);
      JavaResolveResult resolveResult = copy.resolveMethodGenerics();
      if (resolveResult instanceof MethodCandidateInfo info &&
          info.getElement() == method &&
          info.getInferenceErrorMessage() == null) {
        candidates.add(parameters[i]);
      }
    }
    return ContainerUtil.getOnlyItem(candidates);
  }
private static @Nullable PsiParameter findWrongParameter(@NotNull PsiMethodCallExpression call,
                                                           @NotNull PsiMethod method,
                                                           @NotNull PsiSubstitutor substitutor, @NotNull PsiTypeParameter typeParameter)