code: public boolean replaceWith(Collection collection) {
          boolean changed = false;
          if (items.size() > 0) {
              items.clear();
              changed = true;
          }
          if (items.addAll(0, collection) && !changed) {
              changed = true;
          }
          if (changed) {
              fireContentsChanged(-1, -1);
          }
          return changed;
      }
docs: Replace this list model's items with the contents of the provided
  collection.
  
  @param collection
  The collection to replace with