Creating a conflict

I am trying to test my conflict handling code but am unsure if its possible to create a conflict using only 1 device.

Here is what I have tried so far:

CBLDocument instance1 = [database existingDocumentWithID: someId];
CBLDocument instance2 = [database existingDocumentWithID: someId];

[instance1 modifyProperties];
[instance2 modifyProperties];

[instance1 save];
[instance2 save];

When instance1 is saved I get revision 2.
When instance2 is saved I get revision 3.

What I expected was to have 2 revision 2’s after calling the second save which would require my code to resolve the conflict and create a revision 3 with the merged changes. Instead I get a revision 3 with only the changes from instance2.

How can I create 2 revision 2’s so that my conflict handling code can execute?

I have figured it out. You must use the special save method saveAllowingConflict.

CBLUnsavedRevision *rev = [conflicts[0] createRevision];
[rev saveAllowingConflict:&error];

CBLUnsavedRevision *rev2 = [document.currentRevision createRevision];
[rev2 saveAllowingConflict:&error];

[document getConflictingRevisions:nil]; // Should return 2