fun getHandlerMethod(handler: Handler<*, *>) : KFunction1<*, *> { val inputType = handler::class.supertypes.first { Handler::class == it.jvmErasure }.arguments[0].type!! return handler::class.memberFunctions.first { it.name == “invoke” && it.valueParameters.size == 1 && it.visibility == KVisibility.PUBLIC && it.valueParameters[0].type == inputType } }