### Question:
CouchDbRepositorySupport implements GenericRepository<T> { public boolean contains(String docId) { return db.contains(docId); } 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 contains_should_return_true_when_doc_exists() { doReturn(Boolean.TRUE).when(db).contains("doc_id"); assertTrue(repo.contains("doc_id")); }
@Test public void contains_should_return_false_when_doc_does_not_exists() { List<Revision> revs = Collections.emptyList(); doReturn(revs).when(db).getRevisions("doc_id"); doReturn(false).when(db).contains("doc_id"); assertFalse(repo.contains("doc_id")); }