private static PsiMethod generateMethodPrototype(PsiMethod method, PsiParameter... params) {
    final PsiMethod prototype = JavaPsiRecordUtil.isCompactConstructor(method) ?
                                new RecordConstructorMember(method.getContainingClass(), false).generateRecordConstructor() :                            
                                (PsiMethod)method.copy();
    final PsiCodeBlock body = prototype.getBody();
    final PsiCodeBlock emptyBody = JavaPsiFacade.getElementFactory(method.getProject()).createCodeBlock();
    PsiModifierList modifierList = prototype.getModifierList();
    if (body != null) {
      body.replace(emptyBody);
    } else {
      modifierList.setModifierProperty(PsiModifier.ABSTRACT, false);
      prototype.addBefore(emptyBody, null);
    }

    final PsiClass aClass = method.getContainingClass();
    if (aClass != null && aClass.isInterface() && !method.hasModifierProperty(PsiModifier.STATIC)) {
      modifierList.setModifierProperty(PsiModifier.DEFAULT, true);
    }

    for (PsiAnnotation annotation : modifierList.getAnnotations()) {
      if (annotation.hasQualifiedName(CommonClassNames.JAVA_LANG_OVERRIDE)) {
        annotation.delete();
      }
    }

    final PsiParameterList parameterList = method.getParameterList();
    Arrays.sort(params, Comparator.comparingInt(parameterList::getParameterIndex).reversed());

    for (PsiParameter param : params) {
      final int parameterIndex = parameterList.getParameterIndex(param);
      Objects.requireNonNull(prototype.getParameterList().getParameter(parameterIndex)).delete();
    }
    return prototype;
  }
private static PsiMethod generateMethodPrototype(PsiMethod method, PsiParameter... params)