title: How do you Mockk a Kotlin top level function?
body: <p><a href="https://mockk.io" rel="noreferrer">Mockk</a> allows mocking static functions, but how does one mock a Kotlin top level function?</p>
  
  <p>For example, if I have a Kotlin file called <code>HelloWorld.kt</code>, how do I mock the <code>sayHello()</code> function?</p>
  
  <hr>
  
  <p><strong>HelloWorld.kt</strong></p>
  
  <pre><code>fun sayHello() = "Hello Kotlin!"
  </code></pre>