 
 (deftest listen-with-concurrency
   (let [queue (create-queue "listen-queue")
-        latch (java.util.concurrent.CountDownLatch. 5)
+        latch (CountDownLatch. 5)
         listener (.listen queue
                    (handler
                      (fn [msg]

      (.request q "boom" None/INSTANCE codecs
        (coerce-publish-options {:context c}))
      (catch Exception e
        (is (instance? javax.jms.IllegalStateRuntimeException (.getCause e)))))))

(deftest receive-should-use-the-passed-context
  (let [c (.createContext default nil)
        q (create-queue "receive-context")]
    (.close c)
    (is (thrown? javax.jms.IllegalStateRuntimeException
          (.receive q codecs (coerce-receive-options {:context c}))))))

(deftest listen-should-use-the-passed-context
  (let [c (.createContext default (coerce-context-options {:host "localhost"}))
        q (create-queue "listen-context")]
    (.close c)
    (is (thrown? javax.jms.IllegalStateRuntimeException
          (.listen q (handler identity) codecs (coerce-listen-options {:context c}))))))

(deftest respond-should-use-the-passed-context
  (let [c (.createContext default (coerce-context-options {:host "localhost"}))
        q (create-queue "listen-context")]
    (.close c)
    (is (thrown? javax.jms.IllegalStateRuntimeException
          (.respond q (handler identity) codecs (coerce-listen-options {:context c}))))))

(deftest subscribe-should-use-the-passed-context
  (let [c (.createContext default (coerce-context-options {:client_id "ham"}))
        t (create-topic "subscribe-context")]
    (.close c)
    (is (thrown? javax.jms.IllegalStateRuntimeException
          (.subscribe t "ham" (handler identity) codecs (coerce-subscribe-options {:context c}))))))

(deftest unsubscribe-should-use-the-passed-context
  (let [c (.createContext default (coerce-context-options {:client_id "ham"}))
        t (create-topic "subscribe-context")]
    (.close c)
    (is (thrown? javax.jms.IllegalStateRuntimeException
          (.unsubscribe t "ham" (coerce-unsubscribe-options {:context c}))))))

(deftest closing-a-listener-should-work


(deftest request-response-with-ttl
  (let [queue (create-queue "rr-queue")
        latch (CountDownLatch. 1)]
    (with-open [listener (.respond queue
                           (handler (fn [m]
                                      (.countDown latch)
