> http://www.onjava.com/pub/a/onjava/2003/11/12/reflection.html?page=2
> gives an excellent
[quoted text clipped - 7 lines]
> How can I access v via reflection? E.g., I cannot assign v to a
> variable in my unit test class because the type Class2 is not visible.
You can get the class of any object with Object.getClass. That works
even if the class is an anonymous inner class.
The name of the class will be something like mypackage.Class1$Class2,
but you don't need to know that if you go through instances.
However, I would suggest a better approach is to test the public
behaviour of the objects. If you need to test the behaviour of private
methods, factor out a relevant slice of the object.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/