title: kotlin; group by multiple fields
body: <p>How can I do a groupBy in my code by three or more fields?
  My code is like below:</p>
  <pre><code>val nozzleSaleReport = nozzleStateList.groupBy {
      {it.shift.id},{it.createUser.id},{it.nozzle.id} // Here I need to add these three fields for grouping operation
  }.map { entry -&gt;
      val max: Float = (entry.value.maxBy { it.nozzleState.finalLitreMechanical }?.nozzleState!!.finalLitreMechanical ?: 0).toString().toFloat()
      val min: Float = (entry.value.minBy { it.nozzleState.finalLitreMechanical }?.nozzleState!!.finalLitreMechanical ?: 0).toString().toFloat()
  
      NozzleSaleReport(entry.value[0].createUser.name, entry.value[0].shift.name,  (max - min).toInt(),entry.value[0].shift.id, entry.value[0].nozzle.id, entry.value[0].nozzle.name)
  }.let {
      println(it)
  }
  </code></pre>