Mocking sealed classes can be quite a pain. I currently favor an Adapter pattern to handle this, but something about just keeps feels weird.
So, What is the best way you mock sealed classes?
Java answers are more than welcome. In fact, I would anticipate that the Java community has been dealing with this longer and has a great deal to offer.
But here are some of the .NET opinions:
For .NET, you could use something like TypeMock, which uses the profiling API and allows you to hook into calls to nearly anything.
1.4m articles
1.4m replys
5 comments
57.0k users