Get unknown key from Clojure Persistent Hash
<p>What is the best way to get an unknown key from a Clojure map? I tried this - </p>

<pre><code>(key {:a "test"})
</code></pre>

<p>which throws this - </p>

<pre><code>ClassCastException clojure.lang.PersistenArrayMap cannot be cast to java.util.Map$Entry
</code></pre>

<p>Looking at the <a href="https://github.com/clojure/clojure/blob/010864f8ed828f8d261807b7345f1a539c5b20df/src/clj/clojure/core.clj#L1518" rel="nofollow noreferrer">source code</a>, this makes sense- </p>

<pre><code>(defn key
  "Returns the key of the map entry."
  {:added "1.0" :static true}
  [^java.util.Map$Entry e]
  (. e (getKey)))
</code></pre>

<p>I also tried this- </p>

<pre><code>(key (java.util.Map$Entry. {:a "test"}))
</code></pre>

<p>Which throws this- </p>

<pre><code>CompilerException java.lang.IllegalArgumentException: No matching ctor found for interface java.util.Map$Entry
</code></pre>

<p>I understand that I can call <code>keys</code> and then pull said <code>key</code> from the <code>KeySeq</code>, but I was curious if there is a simple way to do this with one function call.</p>

<p>This is <a href="https://stackoverflow.com/q/4313505/3100284">a related question</a> in terms of interop. Thanks for the input.</p>