title: Kotlin - Count the number of items from the List of data class based on field value
body: <p>What is the easiest or cleaner way of counting the total number of item from list where value is equal to 'condition'?</p>
  <p>Lets say I have this data class</p>
  <pre><code>data class Sample(
      val status: String = &quot;Sample&quot;
  ){
       var isSelected: Boolean = false
  } 
  </code></pre>
  <p>I need the total number of item from a <code>List&lt;Sample&gt;</code> where <code>isSelected</code> is <code>true</code>. Doing for loops is boring for this and wanted to make it shorter.
  TIA</p>