title: maxBy((Map.Entry<K, V>) -> R): Map.Entry<K, V>?' is deprecated. Use maxByOrNull instead
body: <p>I'm trying to use maxBy in kotlin but I get a deprecated warning to replace it with maxByOrNull.</p>
  <pre><code>val max = response.maxBy { it.value.size }
  </code></pre>
  <blockquote>
  <p>maxBy((Map.Entry&lt;K, V&gt;) -&gt; R): Map.Entry&lt;K, V&gt;?' is deprecated. Use maxByOrNull instead.</p>
  </blockquote>
  <p>The autofix in android studio does it like below</p>
  <pre><code>val max = maxByOrNull({ it.value.size })
  </code></pre>
  <p>But this doesn't compile with error</p>
  <blockquote>
  <p>Unresolved reference: maxByOrNull</p>
  </blockquote>
  <p>What is the proper implementation as <code>response.maxByOrNull { it.value.size }</code> also doesn't work</p>