title: Converting java.util.function.Function to Kotlin's functional interface type
body: <p>I am working with two modules that are coded in Java and Kotlin respectively, hence require some bit of interoperability. </p>
  
  <p>In one of the cases the java module returns functional interfaces with the type <code>java.util.function.Function</code>, which is to be consumed by the kotlin code.</p>
  
  <p>I could use the java type as it is. However, I would like to be able to cast this to kotlin's native type, be it <code>kotlin.Function</code> or <code>kotlin.reflect.KFunction</code>. The reason behind doing so is to be able to support a similar kotlin module as that of the java one, which surfaces functions for the client.</p>
  
  <p>Is there any way to do this?</p>