How to "Mock" Final Classes With Mockito
If you are using mockito, then you cannot "mock" final classes. But there is a nice library called JDave which does some bytecode, i.e. CGLIB, magic to change final classes to non-final classes.
Just download JDave, add the JAR files to the classpath, and start your test cases with the following VM option:
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)