!7 sinterface MyInterface { S hello(); } sclass MyImpl { S hello() { ret "hello"; } S hello2() { ret "hello2"; } } cprint { start-thread { MyInterface proxy = proxy(new MyImpl, MyInterface); assertEqualsVerbose("hello", proxy.hello()); // reflectively calling a method on a proxy is OK // - if the method is in the interface assertEqualsVerbose("hello", call(proxy, "hello")); // Random method calls, OTOH, are not forwarded to the // proxied object. assertFailsVerbose(r { call(proxy, "hello2") }); // But of course we can extract the proxied object and call its methods. O proxied = getProxiedObject(proxy); assertEqualsVerbose("hello2", call(proxied, "hello2")); } }