@Override
  public void delete() throws IncorrectOperationException {
    PsiPattern pattern = getPattern();
    if (pattern instanceof PsiTypeTestPattern) {
      if (pattern.getParent() instanceof PsiInstanceOfExpression) {
        pattern.replace(getTypeElement());
        return;
      }
    }
    super.delete();
  }
@Override
  public void delete()