static A singleObjectMethodProxy(Class intrface, O object, S methodName) {
ret proxyFromInvocationHandler(intrface, new InvocationHandler {
public O invoke(O proxy, Method method, O[] args) {
S mname = method.getName();
ifdef singleObjectMethodProxy_debug
print("Proxy method called: " + mname + " " + toList(args));
endifdef
if (mname.equals(methodName))
ret call(object, methodName, unnull(args));
if (mname.equals("toString"))
ret "proxy for " + methodName;
null;
}
});
}