@Override
  public void deleteElement() throws IncorrectOperationException {
    final PsiElement parent = getElement().getParent();
    LOG.assertTrue(parent instanceof PsiReferenceList);
    final PsiClass refClass = getReferencedElement();
    final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(refClass.getProject());

    boolean targetTypeParameter = myExtendingClass instanceof PsiTypeParameter;
    copyExtendsList(refClass, refClass.getExtendsList(), refClass.isInterface() == myExtendingClass.isInterface() || targetTypeParameter, elementFactory);
    copyExtendsList(refClass, refClass.getImplementsList(), targetTypeParameter, elementFactory);

    getElement().delete();

    if (!refClass.hasModifierProperty(PsiModifier.SEALED)) return;
    SealedUtils.removeFromPermitsList(refClass, myExtendingClass);
    final PsiModifierList modifiers = myExtendingClass.getModifierList();
    if (modifiers == null || !modifiers.hasModifierProperty(PsiModifier.NON_SEALED)) return;
    if (!SealedUtils.hasSealedParent(myExtendingClass)) {
      modifiers.setModifierProperty(PsiModifier.NON_SEALED, false);
    }
  }
@Override
  public void deleteElement()