title: Create json array with hashtable in java
body: <p>I'm a little confused on how to construct associative arrays from a hashtable in java with either JSONObject() or the gson library from google.</p>
  
  <p>Any help on this is appreciated!</p>
  
  <pre><code>    JSONObject message = new JSONObject();
      Map&lt;String,String&gt; responseData = new Hashtable&lt;String, String&gt;();
  </code></pre>
  
  <p>[...]</p>
  
  <pre><code>    ResultSet results = getApprovalCount.executeQuery();
  
      while (results.next()) {
          responseData.put("vote" + results.getString("submission_id"), results.getString("counter"));
      }
  </code></pre>
  
  <p>[...]</p>
  
  <pre><code>    message.put("submissions", responseData);
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>{"submissions":{"vote1":"2","vote7":"1","vote25":"1","vote6":"1","vote13":"1","vote9":"1","vote11":"1"}}
  </code></pre>
  
  <p>Desired result:</p>
  
  <pre><code>{"submissions":[{"vote1":"2"},{"vote7":"1"},{"vote25":"1"},{"vote6":"1"},{"vote13":"1"},{"vote9":"1"},{"vote11":"1"}]}
  </code></pre>