Perhaps we should check for the number of arguments to the method too? The proxy is being created for the initial context class name as the super class (line 80), so in theory, the user application could cast the returned (proxy) context a FooBarContext and can invoke a close(someParameterAllowedByFooBarContext), in which case we should let this invocation handler invoke that method.

I know it's a very borderline case and possibly just a theoretical one and may not happen in practice, so I won't have an objection if you want it to stay this way.