### Question:
CouchDbRepositorySupport implements GenericRepository<T> { public void add(T entity) { assertEntityNotNull(entity); Assert.isTrue(Documents.isNew(entity), "entity must be new"); db.create(entity); } protected  CouchDbRepositorySupport(Class<T> type, CouchDbConnector db); protected  CouchDbRepositorySupport(Class<T> type, CouchDbConnector db, boolean createIfNotExists); protected  CouchDbRepositorySupport(Class<T> type, CouchDbConnector db, String designDocName); protected  CouchDbRepositorySupport(Class<T> type, CouchDbConnector db, String designDocName, boolean createIfNotExists); void add(T entity); List<T> getAll(); T get(String id); T get(String id, Options options); T get(String id, String rev); void remove(T entity); void update(T entity); void initStandardDesignDocument(); boolean contains(String docId); void setDesignDocumentFactory(
			DesignDocumentFactory df); static final String AUTO_UPDATE_VIEW_ON_CHANGE; }### Answer:
@Test public void add_should_create_a_doc_in_db() { TestDoc t = new TestDoc("id", "f"); doNothing().when(db).create(t); repo.add(t); verify(db).create(eq(t)); }
@Test public void add_should_accept_doc_with_no_id_set() { TestDoc t = new TestDoc("f"); doNothing().when(db).create(t); repo.add(t); verify(db).create(eq(t)); }
@Test(expected = IllegalArgumentException.class) public void add_should_reject_old_doc() { TestDoc t = new TestDoc("id", "f"); t.setRevision("old_revision"); repo.add(t); }