String upsertTestId = "foo";
mongoClient.insert(collection, doc, onSuccess(id -> {
assertNotNull(id);
JsonObject replacement = createDoc();
replacement.put("replacement", true);
<BUG>mongoClient.replaceDocumentsWithOptions(collection, new JsonObject().put("_id", upsertTestId), replacement, new UpdateOptions(true), onSuccess(v -> {
mongoClient.find(collection, new JsonObject(), onSuccess(list -> {
assertEquals(upsertTestId, v.getDocUpsertedId().getString(MongoClientUpdateResult.ID_FIELD));</BUG>
assertEquals(0, v.getDocMatched());
assertEquals(0, v.getDocModified());

String upsertTestId = "foo";
mongoClient.insert(collection, doc, onSuccess(id -> {
assertNotNull(id);
JsonObject replacement = createDoc();
replacement.put("replacement", true);
mongoClient.replaceDocumentsWithOptions(collection, new JsonObject().put("_id", upsertTestId), replacement, new UpdateOptions(true), onSuccess(v -> {
mongoClient.find(collection, new JsonObject(), onSuccess(list -> {assertEquals(upsertTestId, v.getDocUpsertedId().getString(MongoClientUpdateResult.ID_FIELD));
assertEquals(0, v.getDocMatched());
assertEquals(0, v.getDocModified());
