static void setupRecordFromDeconstructionPattern(@Nullable PsiClass aClass, final @NotNull PsiDeconstructionPattern pattern,
                                                   @IntentionName @NotNull String text) {
    if (aClass == null) return;

    final PsiJavaCodeReferenceElement classReference = pattern.getTypeElement().getInnermostComponentReferenceElement();
    if (classReference != null && aClass.isPhysical()) {
      classReference.bindToElement(aClass);
    }

    PsiDeconstructionList deconstructionList = pattern.getDeconstructionList();
    final Project project = aClass.getProject();
    if (deconstructionList.getDeconstructionComponents().length != 0) {
      TemplateBuilderImpl templateBuilder = createRecordHeaderTemplate(aClass, deconstructionList);
      CreateFromUsageBaseFix.startTemplate(project, aClass, templateBuilder.buildTemplate(), text);
    }
    else {
      CodeInsightUtil.positionCursor(project, aClass.getContainingFile(), ObjectUtils.notNull(aClass.getNameIdentifier(), aClass));
    }
  }
static void setupRecordFromDeconstructionPattern(@Nullable PsiClass aClass, final @NotNull PsiDeconstructionPattern pattern,
                                                   @IntentionName @NotNull String text)