public Response[] createDocAndUpdateTwoTimes(CouchClientWrapper db) {
    Response res1 = db.create(new Bar());
    Bar bar1 = db.get(Bar.class, res1.getId());

    Response res2 = db.update(bar1.getId(), bar1);
    Assert.assertNotNull(res2);
    Assert.assertEquals(res1.getId(), res2.getId());
    Bar bar2 = db.get(Bar.class, res1.getId());

    Response res3 = db.update(bar2.getId(), bar2);
    Assert.assertEquals(res1.getId(), res3.getId());
    Bar bar3 = db.get(Bar.class, res1.getId());
    Assert.assertNotNull(bar3);
    return new Response[] {res1, res2, res3};
  }
  @Test
  public void bulk_twoDocs_docsShouldBeCreated() {

    String objectId1 = "haha";
    String objectId2 = "hehe";

    List<BasicDocumentRevision> objects = createTwoDBObjects(remoteDb, objectId1, objectId2);

    remoteDb.bulkCreateDocs(objects);

    Map<String, Object> obj1 = remoteDb.get(Map.class, objectId1);
    Assert.assertNotNull(obj1);
    Assert.assertEquals(objects.get(0).getRevision(), obj1.get("_rev"));

    Map<String, Object> obj2 = remoteDb.get(Map.class, objectId2);
    Assert.assertNotNull(obj2);
    Assert.assertNotNull(obj2.get("_rev"));
    Assert.assertEquals(objects.get(1).getRevision(), obj2.get("_rev"));
  }
  public Response[] createTwoDocumentsInRemoteDb(CouchClientWrapper db) {
    Bar bar1 = new Bar();
    Response res1 = db.create(bar1);
    Assert.assertNotNull(res1);

    Bar bar2 = new Bar();
    Response res2 = db.create(bar2);
    bar2 = db.get(Bar.class, res2.getId());

    Response res3 = db.update(bar2.getId(), bar2);
    Assert.assertNotNull(res3);
    return new Response[] {res1, res2};
  }
  public Response[] createDocUpdateTwoTimesThenDelete(CouchClientWrapper remoteDb) {
    Response res1 = remoteDb.create(new Bar());
    Bar bar1 = remoteDb.get(Bar.class, res1.getId());

    Response res2 = remoteDb.update(bar1.getId(), bar1);
    Assert.assertNotNull(res2);
    Assert.assertEquals(res1.getId(), res2.getId());
    Bar bar2 = remoteDb.get(Bar.class, res1.getId());

    Response res3 = remoteDb.update(bar2.getId(), bar2);
    Assert.assertEquals(res1.getId(), res3.getId());
    Bar bar3 = remoteDb.get(Bar.class, res1.getId());
    Assert.assertNotNull(bar3);

    Response res4 = remoteDb.delete(bar3.getId(), bar3.getRevision());
    Assert.assertEquals(res1.getId(), res4.getId());
    try {
      Bar bar4 = remoteDb.get(Bar.class, res1.getId());
      Assert.fail();
    } catch (NoResourceException e) {
    }
    return new Response[] {res1, res2, res3, res4};
  }