public static void applyChanges(@Nonnull Document doc,
@Nonnull UpdateOp update,
@Nonnull Comparator<Revision> comparator) {
for (Entry<Key, Operation> e : checkNotNull(update).getChanges().entrySet()) {
Key k = e.getKey();
Operation op = e.getValue();
switch (op.type) {
case SET: {
doc.put(k.toString(), op.value);
break;
}