title: Idiomatic way of handling nullable or empty List in Kotlin
body: <p>Say I have a variable <code>activities</code> of type <code>List&lt;Any&gt;?</code>. If the list is not null and not empty, I want to do something, otherwise I want to do something else. I came up with following solution:</p>
  
  <pre><code>when {
      activities != null &amp;&amp; !activities.empty -&gt; doSomething
      else -&gt; doSomethingElse
  }
  </code></pre>
  
  <p>Is there a more idiomatic way to do this in Kotlin?</p>