create(service: Class<T>): T { return Proxy.newProxyInstance( service.classLoader, Array(1) { service }, InvocationHandler { proxy, method, args -> Log.d(TAG, "start") Log.d(TAG, method.name + if (args.isNotEmpty()) args[0] else "") Log.d(TAG, "end") } ) as T } val service = create(Service::class.java) service.doSomething(1000) ϩάग़ྗ start doSomething1000 end