Here's something I'd like to do, but I don't know if it is possible. I'd like take a class that constructs some object of another class and have it load another class entirely rather than the one that is named in the "new" expression. The class that is loaded would have a different name, but it would be signature compatible with the named class in the source.
Oh, and I'd like to be able to do this over and over again replacing the class with different classes in different methods.
In case you are wondering, this is for a testing tool. I just don't know whether hotswap or any of the newer Java features would allow me to do this. Anyone have any pointers?