   (last-key [_] last-key)
   (resolve [_] node))
 
+(defn print-testing-addr
+  [node ^Writer writer fully-qualified?]
+  (.write writer (if fully-qualified?
+                   (pr-str TestingAddr)
+                   "TestingAddr"))
+  (.write writer (str {})))
+
+(defmethod print-method TestingAddr
+  [node writer]
+  (print-testing-addr node writer false))
+
+(defmethod print-dup TestingAddr
+  [node writer]
+  (print-testing-addr node writer true))
+
+(defmethod pp/simple-dispatch TestingAddr
+  [node]
+  (let [out ^Writer *out*]
+    (.write out (str "TestingAddr"
+                     (node-status-bits node)))
+    (.write out (str {}))))
+
 ;;TODO make this a loop/recur instead of mutual recursion
 (declare flush-tree)
 

           cleaned-node (assoc tree :children cleaned-children)
           new-addr (->TestingAddr (last-key tree) cleaned-node)]
       (deliver (:storage-addr tree) new-addr)
       {:tree new-addr :stats (update-in stats [:writes] inc)})
     {:tree tree :stats stats})))

(comment
  (clojure.pprint/pprint (apply b-tree (range 30)))

  (let [t (:tree (flush-tree (apply b-tree (range 30))))]
    (assert (= 0 (:writes (:stats (flush-tree t)))))
    (assert (= (range 30) (lookup-fwd-iter t -1)))
    (:stats (flush-tree (insert t -7)))
    )



  [node writer]
  (print-index-node node writer true))

(defn node-status-bits
  [node]
  (str "["
       (if (dirty? node) "D" " ")
       "]"))

(defmethod pp/simple-dispatch IndexNode
  [node]
  (let [out ^Writer *out*]
    (.write out "IndexNode")
    (.write out (node-status-bits node))
    (pp/pprint-logical-block
      :prefix "{" :suffix "}"
      (pp/pprint-logical-block
