   (when-let [header (-> (cookie-spec)
                         (.formatCookies [(to-basic-client-cookie cookie)])
                         first)]
-    (.getValue ^org.apache.http.Header header)))
+    (.getValue ^Header header)))
 
 (defn encode-cookies
   "Encode the cookie map into a string."

(ns clj-http.cookies
  (:require [clj-http.util :refer [opt]]
            [clojure.string :refer [blank? join lower-case]])
  (:import (org.apache.http.client.params ClientPNames CookiePolicy)
           (org.apache.http.cookie ClientCookie CookieOrigin)
           (org.apache.http.params BasicHttpParams)
           (org.apache.http.impl.cookie BasicClientCookie2)
           (org.apache.http.impl.cookie BrowserCompatSpecFactory)
           (org.apache.http.message BasicHeader)
           org.apache.http.client.CookieStore))

(defn cookie-spec ^org.apache.http.cookie.CookieSpec []
  (.newInstance
   (BrowserCompatSpecFactory.)
   (doto (BasicHttpParams.)
     (.setParameter ClientPNames/COOKIE_POLICY
                    CookiePolicy/BROWSER_COMPATIBILITY))))

(defn compact-map
  "Removes all map entries where value is nil."

     :value (.getValue cookie)
     :version (.getVersion cookie)})])

(defn ^BasicClientCookie2
  to-basic-client-cookie
  "Converts a cookie seq into a BasicClientCookie2."
  [[cookie-name cookie-content]]
