                     throw err
 
     go()
-    client.live += "more stuffklajsdf lasdjf lasdj flasdjf lasjdfljas dfaklsdjflkasjd flajsdflkjasdklfj"
-    server.live = 'bar' + server.live + "lkajsdfllkjasdfl jasdlfj alsdkfjas'dfjlkasdjflasjdfkljasdf"
+    if DocClass?
+        client.live = new DocClass("bar more stuffklajsdf lasdjf lasdj flasdjf lasjdfljas dfaklsdjflkasjd flajsdflkjasdklfj" + misc.uuid())
+        server.live = new DocClass("bar lkajsdfllkjasdfl jasdlfj alsdkfjasdfjlkasdjflasjdfkljasdf" + misc.uuid())
+    else
+        client.live += "more stuffklajsdf lasdjf lasdj flasdjf lasjdfljas dfaklsdjflkasjd flajsdflkjasdklfj" + misc.uuid()
+        server.live = 'bar' + server.live + "lkajsdfllkjasdfl jasdlfj alsdkfjas'dfjlkasdjflasjdfkljasdf" + misc.uuid()
     status()
-    while client.live != server.live
+    while not Doc_equal(client.live, server.live)
         status()
         go()
     status()

                        @shadow = result
                        @shadow_version  += 1
                        @_apply_edits_to_live(edits.edits, cb)
            else
                if edits.shadow_version < @shadow_version
                    # Packet duplication or loss: ignore -- it will sort itself out later.


class CustomDiffSync extends DiffSync
    constructor: (opts) ->
        #IMPORTANT: (1) None of the custom functions below take callbacks
        # as the last argument!
        # (2) You really, really want to define patch_in_place.  You must if doc0 = doc1 doesn't work.
        opts = defaults opts,
            id       : undefined   # anything you want; or leave empty to have a uuid randomly assigned
            doc      : required    # the starting live document
