### Question:
EntityCollection extends BaseObject { public T add(T item) { logger.debug("Adding the item {} to the collection", item); return addOrRemove(item, true); }  T add(T item); T remove(T item); T findById(Serializable id); List<T> all(); T first(Object... paramValues); T one(Object... paramValues); List<T> where(Filter filter); List<T> where(Object... paramValues); long count(Filter filter); void persist();  }### Answer:
@Test public void shouldAddItemToCollectionUsingAddMethod() { ParentWithAddMethod parent = new ParentWithAddMethod(); EntityCollection<DummyModel> collection = new EntityCollection<DummyModel>(parent, "models", DummyModel.class); collection.add(model); assertEquals(parent.models.size(), 1); }
@Test public void shouldAddItemToCollectionUsingGetter() { ParentWithGetter parent = new ParentWithGetter(); EntityCollection<DummyModel> collection = new EntityCollection<DummyModel>(parent, "models", DummyModel.class); collection.add(model); assertEquals(parent.models.size(), 1); }
@Test public void shouldAddItemToCollectionUsingField() { ParentWithField parent = new ParentWithField(); EntityCollection<DummyModel> collection = new EntityCollection<DummyModel>(parent, "models", DummyModel.class); collection.add(model); assertEquals(parent.models.size(), 1); }