public static PsiParameter @NotNull [] overriddenParameters(PsiParameter @NotNull [] parameters,
                                                              @NotNull JVMElementFactory factory,
                                                              @NotNull JavaCodeStyleManager codeStyleManager,
                                                              @NotNull PsiSubstitutor substitutor,
                                                              @Nullable PsiElement target) {
    PsiParameter[] result = new PsiParameter[parameters.length];
    UniqueNameGenerator generator = new UniqueNameGenerator();

    for (int i = 0; i < parameters.length; i++) {
      PsiParameter parameter = parameters[i];
      final PsiType parameterType = parameter.getType();
      PsiElement declarationScope = parameter.getDeclarationScope();
      PsiType substituted = declarationScope instanceof PsiTypeParameterListOwner ? substituteType(substitutor, parameterType, (PsiTypeParameterListOwner)declarationScope, parameter.getModifierList())
                                                                                  : parameterType;
      String paramName = parameter.getName();
      boolean isBaseNameGenerated = true;
      final boolean isSubstituted = substituted.equals(parameterType);
      if (!isSubstituted && isBaseNameGenerated(codeStyleManager, TypeConversionUtil.erasure(parameterType), paramName)) {
        isBaseNameGenerated = false;
      }

      if (isBaseNameGenerated && !isSubstituted && isBaseNameGenerated(codeStyleManager, parameterType, paramName) ||
          !factory.isValidParameterName(paramName)) {
        String[] names = codeStyleManager.suggestVariableName(VariableKind.PARAMETER, null, null, substituted).names;
        if (names.length > 0) {
          paramName = generator.generateUniqueName(names[0]);
        }
        else {
          paramName = generator.generateUniqueName("p");
        }
      }
      else if (!generator.value(paramName)) {
        paramName = generator.generateUniqueName(paramName);
      }
      generator.addExistingName(paramName);
      PsiType expressionType = GenericsUtil.getVariableTypeByExpressionType(substituted);
      if (expressionType instanceof PsiArrayType && substituted instanceof PsiEllipsisType) {
        expressionType = new PsiEllipsisType(((PsiArrayType)expressionType).getComponentType())
          .annotate(expressionType.getAnnotationProvider());
      }
      result[i] = factory.createParameter(paramName, expressionType, target);
    }
    return result;
  }
public static PsiParameter @NotNull [] overriddenParameters(PsiParameter @NotNull [] parameters,
                                                              @NotNull JVMElementFactory factory,
                                                              @NotNull JavaCodeStyleManager codeStyleManager,
                                                              @NotNull PsiSubstitutor substitutor,
                                                              @Nullable PsiElement target)