sO handleObjectMethodsInProxyInvocationHandler( O invocationHandler, Method implementedMethod, Method method, O proxy, O[] actualArgs) { S name = method.getName(); if (name.equals("hashCode")) ret invocationHandler.hashCode(); if (name.equals("equals")) ret proxy == actualArgs[0]; if (name.equals("toString")) ret invocationHandler.toString(); fail("No handler for method " + method + " (only have " + implementedMethod + ")"); }