     (swap! changes-n inc))
   (close [this] (assoc this :closed true)))
 
-(defn create-persistence [] (->MockedPersistence (atom 0) (atom 0) false nil nil))
+(defn create-persistence [] (->MockedPersistence (atom {}) (atom 0) (atom {}) (atom 0)))
 
 (defn create-projectors [n]
   (repeatedly n #(->MockedProjector (atom 0) (atom 0))))

          invalid-new-feature (transform valid-new-feature)
          processed (first(consume processor invalid-new-feature))]
      (testing (str name " should break")
        (is (not (nil? processed)))
        (is (:invalid? processed))
        (is (= 0 @(-> processor :persistence :streams-n)))
        (is (= 0 @(-> processor :persistence :appends-n)))
        (is (= 0 @(-> processor :projectors first :features-n)))))))

(deftest ok-change-feature
  (let [processor (-> (create-processor)
                      (assoc-in [:persistence :current-validity] default-validity)
                      (assoc-in [:persistence :exists?] true))
        processed (first (consume processor valid-change-feature))]
    (is (not (nil? processed)))
    (is (not (:invalid? processed)) (str (:invalid-reasons processed)))
    (is (= 0 @(-> processor :persistence :streams-n))) ; no new stream
    (is (= 1 @(-> processor :persistence :appends-n)))
    (is (= 0 @(-> processor :projectors first :features-n))) ; no new features
    (is (= 1 @(-> processor :projectors first :changes-n)))
    ))

      (testing (str name " should break")
        (is (not (nil? processed)))
        (is (:invalid? processed))
        (is (= 0 (-> processor :persistence :events-n deref)))
        (is (= 0 @(-> processor :projectors first :features-n))) ; no new features
        (is (= 0 @(-> processor :projectors first :changes-n))))
      )))
