title: Class literal syntax for parameterized classes in Kotlin
body: <p>I'm trying to mock a function in Kotlin</p>
  
  <pre><code>Mockito.mock(Function2&lt;Int, Int, Unit&gt;::class.java)
  </code></pre>
  
  <p>and it says <em>"Only classes are allowed on the left hand side of a class literal"</em>. What's the proper way to obtain a reference to a statically known parameterized class? For now I live with an ugly cast</p>
  
  <pre><code>Mockito.mock(Function2::class.java) as (Int, Int) -&gt; Unit
  </code></pre>