title: Converting Clojure data structures to Java collections
body: <p>What is the Clojure-idiomatic way to convert a data structure to a Java collection, specifically:</p>
  
  <ul>
  <li><code>[]</code> to a <code>java.util.ArrayList</code></li>
  <li><code>{}</code> to a <code>java.util.HashMap</code></li>
  <li><code>#{}</code> to a <code>java.util.HashSet</code></li>
  <li><code>()</code> to a <code>java.util.LinkedList</code></li>
  </ul>
  
  <p>Is there a clojure.contrib library to do this?</p>
  
  <p><strong>USE CASE</strong>: In order to ease Clojure into my organization, I am considering writing a unit-test suite for an all-Java REST server in Clojure. I have written part of the suite in Scala, but think that Clojure may be better because the macro support will reduce a lot of the boilerplate code (I need to test dozens of similar REST service calls).</p>
  
  <p>I am using EasyMock to mock the database connections (is there a better way?) and my mocked methods need to return <code>java.util.List&lt;java.util.Map&lt;String, Object&gt;&gt;</code> items (representing database row sets) to callers. I would pass in a <code>[{ "first_name" "Joe" "last_name" "Smith" "date_of_birth" (date "1960-06-13") ... } ...]</code> structure to my mock and convert it to the required Java collection so that it can be returned to the caller in the expected format.</p>