title: Converting a HashMap using moshi
body: <p>I'm trying to convert a <code>HashMap</code> of elements into a JSON string. I'm using the method used in this <a href="https://github.com/square/moshi/issues/173" rel="noreferrer">link</a>. </p>
  
  <pre><code> val elementsNew: HashMap&lt;String, Element&gt; = HashMap(elements)
   val type = Types.newParameterizedType(Map::class.java, String::class.java, Element::class.java)
   var json: String = builder.adapter(type).toJson(elementsNew)
  </code></pre>
  
  <p>But this gives the following error</p>
  
  <blockquote>
    <p>Error:(236, 40) Type inference failed: Not enough information to infer
    parameter T in fun  adapter(p0: Type!): JsonAdapter!
    Please specify it explicitly.</p>
  </blockquote>
  
  <p>Can any one tell me where's the fault? Is it because of Kotlin?</p>