@Test
public void testToUpdateDocument() throws Exception {

    Update<TestUser> update = Update.of(
            TestUser.builder().birthday(LocalDate.of(1980, 5, 12)).build(),
            ImmutableSet.of("birthday"),
            ImmutableSet.of("email"));
    Instant now = Instant.now();
    ObjectId updater = new ObjectId();
    Document doc = dao.toUpdateDocument(update, now, updater);
    Document expected = new Document("$set",
            new Document("birthday", "1980-05-12")
                .append("updateAt", Date.from(now))
                .append("updateId", updater))
            .append("$unset", new Document("email", 1));
    assertEquals(expected, doc);
}