code: public void replaceItem(CmsListItem item) {
  
          CmsListItem oldItem = getList().getItem(item.getId());
          if (oldItem != null) {
              int index = getList().getWidgetIndex(oldItem);
              getList().removeItem(oldItem);
              if (index >= getList().getWidgetCount()) {
                  getList().addItem(item);
              } else {
                  getList().insertItem(item, index);
              }
          }
      }
docs: Replaces the item with the same id if present.<p>
  
  @param item the new item