anchor.diff:                                  "http://example.root/B" "http://example.root/B2" "b-data"))
                       #'string<)))
     (let* ((history (make-history1))
  -         (creator (htree:current-owner-id history))
  +         (creator *owner*)
            (distant-node-value "b-data"))
       (htree:add-owner history "b" :creator-id creator)
  -    (htree:set-current-owner history "b")
  -    (htree:add-child distant-node-value history)
  -
  -    (htree:set-current-owner history htree:+default-owner+)
  -    (htree:backward history 2)
  +    (htree:add-child distant-node-value history "b")
  +
  +    (htree:backward history *owner* 2)
   
       (let ((distant-node (first (htree:find-nodes history distant-node-value))))
  -      (htree:visit-all history distant-node))
  -
  -    (prove:is (htree:data (htree:current-owner-node history))
  +      (htree:visit-all history *owner* distant-node))
  +
  +    (prove:is (htree:data (htree:owner-node history *owner*))
                 distant-node-value)
  -    (prove:is (sort (mapcar #'htree:data (htree:nodes (htree:owner history htree:+default-owner+)))
  +    (prove:is (sort (mapcar #'htree:data (htree:nodes (htree:owner history *owner*)))
                       #'string<)
                 (sort (copy-seq '("http://example.root/A"
                                   "http://example.root/A1"
  
positive.code:                 (sort (mapcar #'title (list web-page1 web-page2)) #'string<)))))
  
  (prove:subtest "Single owners"
    (let ((history (htree:make))
          (url1 "http://example.org"))
      (htree:add-child url1 history)
      (prove:is (htree:current-owner-id history)
                htree:+default-owner+)
      (prove:is (hash-table-count (htree:owners history))
                1)))
  
  (prove:subtest "Multiple owners"
    (let ((history (htree:make :current-owner-id "a"))
          (url1 "http://example.org")
          (url2 "https://nyxt.atlas.engineer")
          (url3 "http://en.wikipedia.org"))
      (htree:add-child url1 history)
      (htree:add-owner history "b")
      (htree:set-current-owner history "b")
      (htree:add-child url2 history)
      (htree:add-child url3 history)
      (prove:is (hash-table-count (htree:entries history))
                3)
      (prove:is (htree:data (htree:current-owner-node history))
                url3)
      (prove:is (htree:data (htree:parent (htree:current-owner-node history)))
                url2)
      (prove:is (htree:parent (htree:parent (htree:current-owner-node history)))
                nil)
      (prove:is (length (htree:nodes (htree:current-owner history)))
                2)
      (prove:is (htree:with-current-owner (history "a")
                  (htree:data (htree:current-owner-node history)))
                url1)))
  
  (prove:subtest "Backward and forward"
    (let ((history (htree:make :current-owner-id "a"))
          (url1 "http://example.org")
          (url2 "https://nyxt.atlas.engineer")
          (url3 "http://en.wikipedia.org"))
      (htree:add-child url1 history)
      (htree:add-child url2 history)
      (htree:add-owner history "b" :creator-id "a")
      (htree:set-current-owner history "b")
      (htree:add-child url3 history)
      (htree:set-current-owner history "a")
      (prove:is (htree:data (htree:current-owner-node history))
                url2)
      (htree:backward history)
      (htree:backward history)
      (prove:is (htree:data (htree:current-owner-node history))
                url1)
      (htree:forward history)
      (prove:is (htree:data (htree:current-owner-node history))
                url2)
      (htree:forward history)
      (prove:is (htree:data (htree:current-owner-node history))
                url2)))
  
  (prove:subtest "Inter-owner relationships"
    (let ((history (htree:make :current-owner-id "a"))
          (url1 "http://example.org")
          (url2 "https://nyxt.atlas.engineer"))
      (htree:add-child url1 history)
      (htree:add-owner history "b" :creator-id "a")
      (htree:set-current-owner history "b")
      (htree:add-child url2 history)
      (prove:is (length (htree:nodes (htree:owner history "a")))
                1)
      (prove:is (length (htree:nodes (htree:owner history "b")))
  
negative.code: ;; 2. Remove 2nd owner.  Test if all these nodes got garbage collected, but not
  ;; the default branch nodes.
  (prove:subtest "Owner deletion"
    (let ((history (make)))
      (dolist (url '("http://example.root"
                     "http://example.root/R"
                     "http://example.root/R1"
                     "http://example.root/R2"))
        (htree:add-child url history *owner*))
      (htree:add-owner history "parent-owner")
      (htree:add-child "http://parent/A" history "parent-owner")
      (htree:add-child "http://parent/A1" history "parent-owner")
      (htree:backward history "parent-owner")
      (htree:add-child "http://parent-child/A2" history "parent-owner")
  
      (htree:add-owner history "child-owner" :creator-id "parent-owner")
      (htree:add-child "http://child/A3a" history "child-owner")
      (htree:backward history "child-owner")
      (htree:add-child "http://child/A3b" history "child-owner")
  
      (prove:is (length (htree:nodes (htree:owner history "parent-owner")))
                3)
      (prove:is (length (htree:all-branch-nodes history "child-owner"))
                5)
      (prove:is (length (htree:nodes (htree:owner history *owner*)))
                4)
  
      (htree:delete-owner history "child-owner")
  
      (prove:is (htree:owner history "child-owner")
                nil)
      (prove:is (length (htree:nodes (htree:owner history "parent-owner")))
                3)
      (prove:is (length (htree:all-branch-nodes history "parent-owner"))
                5)
      (prove:is (length (htree:nodes (htree:owner history *owner*)))
                4)
  
      (dolist (url-owner (list '("http://parent/A" "parent-owner")
  