title: Create list of objects with generated key value in Kotlin
body: <p>New in Kotlin;
  I need to get a list of HeightModel class objects from the function</p>
  
  <pre><code>class HeightModel(id: Int, height: Int)
  </code></pre>
  
  <p>I am using below code. but getting an empty list</p>
  
  <pre><code>var i = 1
  var j = 145
  val li = emptyList&lt;HeightModel&gt;()
  while(i &lt; 46 &amp;&amp; j &lt; 191){
      li.toMutableList().add(HeightModel(i, j))
      i ++
      j ++
   }
  return li
  </code></pre>
  
  <p>I am getting an emptylist instead. My expected result shall be </p>
  
  <pre><code>listOf(HeightModel(1, 145), HeightModel(2, 146) .....HeightModel(46, 190))
  </code></pre>
  
  <p>Help is generously appreciated</p>