         (let [cmr-keyword-scheme (translate-keyword-scheme-to-cmr orig-keyword-scheme)
               gcmd-keyword-scheme (translate-keyword-scheme-to-gcmd orig-keyword-scheme)
               keywords (vals (gcmd-keyword-scheme (kf/get-gcmd-keywords-map context)))
-              _ (cmr.common.dev.capture-reveal/capture keywords)
               hierarchical-keywords (parse-hierarchical-keywords
                                       (cmr-keyword-scheme frf/nested-fields-mappings) keywords)]
           {:staus 200

    (keyword->hierarchy (nth example-keywords 2) [:a :b :c :d]))



  (merge-hierarchical-maps hm1 hm2)
  )

(defn create-branch-nodes

  (def node-type
    (s/OR branch-node-type leaf-node-type))

  (def expected-result
    {:a [{:value "A1"
          :subfields ["c"]
          :c [{:value "C1"
               :uuid "a1c1"
               :subfields ["d"]
               :d [{:value "D1"
                    :uuid "a1c1d1"}]}]}
         {:value "A2"
          :uuid "a2"
          :subfields ["d"]
          :d [{:value "D1"
               :uuid "a2d1"}]}
         {:value "A3"
          :subfields ["b" "c" "d"]
          :b [{:value "B1"
               :subfields ["c"]
               :c [{:value "C1"
                    :subfields ["d"]
                    :d [{:value "D1"
                         :uuid "a3b1c1d1"}]}]}]
          :c [{:value "C2"
               :uuid "a3c2"}]
          :d [{:value "D2"
               :uuid "a3d2"}]}]})

  {:a "A1" :c "C1" :uuid "a1c1"}

  {:a [{:value "A1"
        :subfields ["b"]
        :b [{:value nil
             :subfields ["c"]
             :c [{:value "C1"
                  :uuid "a1c1"}]}]}]}

  (def example-keywords
    [{:a "A1" :c "C1" :uuid "a1c1"}
     {:a "A1" :c "C1" :d "D1" :uuid "a1c1d1"}
     {:a "A2" :uuid "a2"}
     {:a "A2" :d "D1" :uuid "a2d1"}
     {:a "A3" :b "B1" :c "C1" :d "D1" :uuid "a3b1c1d1"}

     {:a "A3" :c "C2" :uuid "a3c2"}
     {:a "A3" :d "D2" :uuid "a3d2"}])

  (def keyword-hierarchy-example [:a :b :c :d])

  (def expected-merged
    {:a [{:value "A3"
          :b [{:value nil
               :c [{:value nil
                    :d [{:value "D2"
                         :uuid "a3d2"
                         }]}
                   {:value "C2"
                    :uuid "a3c2"
                    :d [{:value nil}]
                    }]}
              {:value "B1"
               :c [{:value "C1"
                    :d [{:value "D1"
                         :uuid "a3b1c1d1"
                         }]}
                   ]}]}
         {:value "A2"
          ; :uuid "a2"
          :b [{:value nil
               :c [{:value nil
                    :d [{:value "D1"
                         :uuid "a2d1"
                         }
                        {:value nil}]}]}]}
         {:value "A1"
          :b [{:value nil
               :c [{:value "C1"
                    :uuid "a1c1"
                    :d [{:value "D1"
                         :uuid "a1c1d1"
                         }
                        {:value nil}]}]}]}]})


  (->> example-keywords
       (map #(keyword->hierarchy % [:a :b :c :d]))
       (reduce merge-hierarchical-maps)
       (= expected-merged)
       )

  (map #(keyword->hierarchy % [:a :b :c :d]) example-keywords)

  )

;; Three steps
