private static String getChildText(PsiClass recordClass, PsiElement child) {
    if (child instanceof PsiKeyword && ((PsiKeyword)child).getTokenType().equals(JavaTokenType.RECORD_KEYWORD)) {
      PsiModifierList modifierList = Objects.requireNonNull(recordClass.getModifierList());
      String text = "class";
      if (!modifierList.hasExplicitModifier(PsiModifier.FINAL)) {
        text = "final " + text;
      }
      if (recordClass.getContainingClass() != null && !modifierList.hasExplicitModifier(PsiModifier.STATIC)) {
        text = "static " + text;
      }
      return text;
    }
    if (child instanceof PsiRecordHeader) {
      return "";
    }
    if (child instanceof PsiDocComment) {
      PsiDocComment copy = (PsiDocComment)child.copy();
      for (PsiDocTag param : copy.findTagsByName("param")) {
        param.delete();
      }
      return copy.getText();
    }
    if (child instanceof PsiMethod && JavaPsiRecordUtil.isCompactConstructor((PsiMethod)child)) {
      return ConvertCompactConstructorToCanonicalAction.generateCanonicalConstructor((PsiMethod)child).getText();
    }
    return child.getText();
  }
private static String getChildText(PsiClass recordClass, PsiElement child)