title: Generic method for convert json string to List of Objects
body: <p>I wanna create generic method for convert json string to List of objects. </p>
  
  <pre><code>fun  convertJsonStringToObjectList(jsonString: String , clazz: Class&lt;Any&gt;) :List&lt;Any&gt;{
          val gson = Gson()
          val objectList = gson.fromJson(jsonString, Array&lt;clazz&gt;::class.java).asList()
          return objectList
  }
  </code></pre>
  
  <p>This code does not works. I know how to convert json string to a class like this:</p>
  
  <pre><code> fun &lt;T&gt; convertJsonStringToObject(jsonString: String, clazz: Class&lt;T&gt;): T {
          val gson = Gson()
          val objectList = gson.fromJson(jsonString, clazz)
          return objectList
      }
  </code></pre>
  
  <p>The problem is i wan to get class type from method and then add Array type to it and get classtype again. I do not know how to handle this.</p>