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.
2.1m questions
2.1m answers
60 comments
57.0k users