title: How to use gson deserialize to ArrayList in Kotlin
body: <p>I use this class to store data</p>
  
  <pre><code>public class Item(var name:String,
                    var description:String?=null){
  }
  </code></pre>
  
  <p>And use it in ArrayList</p>
  
  <pre><code>public var itemList = ArrayList&lt;Item&gt;()
  </code></pre>
  
  <p>Use this code to serialize the object</p>
  
  <pre><code>val gs=Gson()
  val itemListJsonString = gs.toJson(itemList)
  </code></pre>
  
  <p>And deserialize</p>
  
  <pre><code>itemList = gs.fromJson&lt;ArrayList&lt;Item&gt;&gt;(itemListJsonString, ArrayList::class.java)
  </code></pre>
  
  <p>But this method will give me <code>LinkedTreeMap</code>, not <code>Item</code>, I cannot cast LinkedTreeMap to Item</p>
  
  <p>What is correct way to deserialize to json in Kotlin?</p>