@Test
public void testDocumentIsInsertedIfNotKnown() {

    // GIVEN
    when(result.getMatchedCount()).thenReturn(Long.valueOf(0));
    final Document data = new Document().append(USER_DEFINED_COLLECTION_NAME_2, Arrays.asList(DOCUMENT_1))
            .append(USER_DEFINED_COLLECTION_NAME_1, Arrays.asList(DOCUMENT_2));
    // WHEN
    operation.execute(connection, data);
    // THEN
    verify(collection, times(2)).replaceOne(any(Bson.class), any(Document.class));
    final ArgumentCaptor<Document> documentCaptor = ArgumentCaptor.forClass(Document.class);
    verify(collection, times(2)).insertOne(documentCaptor.capture());
    final List<Document> capturedDocuments = documentCaptor.getAllValues();
    assertThat(capturedDocuments.size(), equalTo(2));
    assertThat(capturedDocuments, hasItems(DOCUMENT_1, DOCUMENT_2));
}