           coll2 (d/ingest "PROV1" (dc/collection {}))
           _ (dev-sys-util/freeze-time! "2000-03-01T10:00:00Z")
           coll3 (d/ingest "PROV1" (dc/collection {}))
+
+          ;; Collection 4 will have updates
           _ (dev-sys-util/freeze-time! "2000-04-01T10:00:00Z")
-          coll4 (d/ingest "PROV1" (dc/collection {}))
+          coll4-1 (d/ingest "PROV1" (dc/collection {}))
+          _ (dev-sys-util/freeze-time! "2000-05-01T10:00:00Z")
+          coll4-2 (d/ingest "PROV1" (dissoc coll4-1 :revision-id))
+
+          ;; Collection D will be deleted
+          _ (dev-sys-util/freeze-time! "2000-06-01T10:00:00Z")
+          coll-d-1 (d/ingest "PROV1" (dc/collection {}))
+
+          _ (dev-sys-util/freeze-time! "2000-07-01T10:00:00Z")
+          _ (ingest/delete-concept (d/item->concept coll-d-1))
+          coll-d-2 (assoc coll-d-1 :deleted true :revision-id 2)
+
           _ (dev-sys-util/freeze-time! "2015-01-01T10:00:00Z")
           coll5 (d/ingest "PROV1" (dc/collection {}))]
       (index/wait-until-indexed)

        (are [colls param value]
             (let [references (search/find-refs :collection {param value})]
               (d/refs-match? colls references))
             [coll1 coll2 coll3 coll4 coll5] "updated_since" "2000-01-01T10:00:00Z"
             [coll1 coll2 coll3 coll4 coll5] "updated_since[]" "2000-01-01T10:00:00Z"
             [coll2 coll3 coll4 coll5] "updated_since" "2000-02-01T00:00:00Z"
             [coll5] "updated_since" "2015-01-01T10:00:00Z"
             [] "updated_since" "2015-01-01T10:00:01Z"))
      (testing "search collections with updated_since range is invalid"

      (testing "search collections with multiple updated_since values is invalid"
        (let [value ["2000-01-01T10:00:00Z" "2009-01-01T10:00:00Z"]
              {:keys [status errors]} (search/find-refs :collection {"updated_since" value})]
          (is (= [400 ["Search not allowed with multiple updated_since values"]]
                 [status errors])))))))


(deftest search-granules-by-revision-date
