                 (assert (every? #(key-lt (aget keys %) (.-lower (aget children (inc %)))) (range (count keys))))
                 (dotimes [i (count children)] (.valid! (aget children i) max-keys))))))
   (pretty-print [this]
-                (str "(" parent-ix ")" "|" (pr-str lower) " " (pr-str (vec keys)) " " (pr-str upper) "|")))
+                (str "(" parent-ix ")" "|" (pr-str lower) " " (pr-str (vec keys)) " " (pr-str upper) "|"))
+  (foreach [this f]
+           (dotimes [i (alength keys)]
+             (when (not (nil? children))
+               (.foreach (aget children i) f))
+             (f (aget keys i) (aget vals i)))
+           (when (not (nil? children))
+             (.foreach (aget children (alength keys)) f))))
 
 (defn tree [min-keys key-len]
   (let [node (Node. nil nil #js [] #js [] nil nil nil)

  (time (dotimes [_ 10] (h)))

  (do
    (def samples (gen/sample (gen/tuple gen/s-pos-int (gen/vector gen-action) (gen/vector gen-movement)) 100))
    (def trees (for [[min-keys actions _] samples]
                 (apply-to-tree (tree min-keys) actions)))
    (def benches (mapv vector trees (map #(nth % 2) samples)))

(defn iterator-prop [key-len]
  (prop/for-all [min-keys gen/s-pos-int
                 actions (gen/vector (gen-action key-len))
                 movements (gen/vector (gen-seek key-len))]
                (run-iterator-prop min-keys key-len actions movements)))

(defn run-self-join-prop [min-keys key-len actions movements]
