               (assert (>= (count keys) min-keys) (pr-str keys min-keys)))
             (assert (<= (count keys) max-keys) (pr-str keys max-keys))
             (assert (= (count keys) (count (set keys))))
-            (assert (= (seq keys) (seq (sort-by identity #(cond (== %1 %2) 0 (lt %1 %2) -1 (gt %1 %2) 1) keys))))
+            (assert (= (seq keys) (seq (sort-by identity compare-keys keys))))
             (assert (every? #(lte lower %) keys) (pr-str lower keys))
             (assert (every? #(gte upper %) keys) (pr-str upper keys))
             (if (nil? children)

     (doseq [[tree movements] benches]
       (apply-to-iterator (iterator tree) movements))))
 )


                (swap! elems rest)
                (first (first @elems)))
        :seek (do
                (swap! elems (fn [elems] (drop-while #(lt-fun (nth % 0) (nth movement 1)) elems)))
                (first (first @elems)))))))

(defn run-iterator-prop [min-keys actions movements]
  (let [tree (apply-to-tree (tree min-keys) actions)
        sorted-map (apply-to-sorted-map (sorted-map-by compare-keys) actions)
        iterator-results (apply-to-iterator (iterator tree) movements)
        elems-results (apply-to-elems (seq sorted-map) movements)]
    (= iterator-results elems-results)))
