   [options]
   (let [cco (ContentCreateOptions.)]
     (when-not (every? valid-content-creation-options (keys options))
-      ;; TODO switch to spec
+      ;; TODO switch to spec?
       (throw (IllegalArgumentException. "Invalid content creation option. Keywords passed in `options` must be a subset of `valid-content-creation-options`.")))
     (let [xs [[:buffer-size #(.setBufferSize cco %)]
               [:collections #(.setCollections cco (into-array String %))]

   :format ((clojure.set/map-invert doc-format) (.getFormat opts))
   :graph (.getGraph opts)
   :language (.getLanguage opts)
   :namespace (.getNamespace opts)
   :permissions (mapv #(hash-map (.getRole %)
                                 (keyword (.toString (.getCapability %))))

    :resolve-entities
    :temporal-collection})

(defn make-content-permissions
  "Return an array of ContentPermissions decribing the given seq of
  content capability keys."
  [permissions]
  (into-array ContentPermission
              (reduce (fn [permissions-acc permission]
                        (conj permissions-acc
                              (ContentPermission.
                               (content-capability (val (first permission)))
                               (key (first permission)))))
                      []
                      permissions)))

(defn content-creation-options
  "Creates a ContentCreateOptions object (to pass to a ContentFactory
  newContent call) out of the given options map. See
