Today, i took a look at another mock framework - JMockit (
https://jmockit.dev.java.net/). The creator of JMockit claims "JMockit Core consists of a single class with a small set of static methods, which allow arbitrary methods and constructors of any other class to be replaced with mock implementations at runtime. "
It overcomes two limits comparing to EasyMock,
(1) mocked classes can't simply be instantiated with the new operator in client or test code.
(2) the classes to be mocked cannot be final
However, JMockit has its own limitation: the argument matcher provided by JMockit is not easy to use comparing to Unitils.