{
    if (isNotificationRequired())
    {
      NotificationChain notifications = null;
      boolean oldIsSet = isSet();
      if (hasShadow())
      {
        notifications = shadowRemove(basicGet(index), null);
      }
      E oldObject;
      NotificationImpl notification = createNotification(Notification.REMOVE, oldObject = doRemove(index), null, index, oldIsSet);
      if (hasInverse() && oldObject != null)
      {
        notifications = inverseRemove(oldObject, notifications);
        if (notifications == null)
        {
          dispatchNotification(notification);
        }
        else
        {
          notifications.add(notification);
          notifications.dispatch();
        }
      }
      else
      {
        if (notifications == null)
        {
          dispatchNotification(notification);
        }
        else
        {
          notifications.add(notification);
          notifications.dispatch();
        }
      }
      return oldObject;
    }
    else
    {
      E oldObject = doRemove(index);
      if (hasInverse() && oldObject != null)
      {
        NotificationChain notifications = inverseRemove(oldObject, null);
        if (notifications != null) notifications.dispatch();
      }
      return oldObject;
    }
  }