@Override
  @Nullable
  public PsiElement substituteElementToRename(@NotNull PsiElement element, Editor editor) {
    PsiMethod psiMethod = (PsiMethod)element;
    if (psiMethod.isConstructor()) {
      PsiClass containingClass = psiMethod.getContainingClass();
      if (containingClass == null) return null;
      if (Comparing.strEqual(psiMethod.getName(), containingClass.getName())) {
        element = containingClass;
        if (!PsiElementRenameHandler.canRename(element.getProject(), editor, element)) {
          return null;
        }
        return element;
      }
    }
    PsiRecordComponent recordComponent = JavaPsiRecordUtil.getRecordComponentForAccessor(psiMethod);
    if (recordComponent != null) {
      return recordComponent;
    }
    return SuperMethodWarningUtil.checkSuperMethod(psiMethod);
  }
@Override
  @Nullable
  public PsiElement substituteElementToRename(@NotNull PsiElement element, Editor editor)