This library can rapidly create a mock implementation of any interface or class using dynamic proxies.
Using the himock.jar library:
Dynamic proxies are a feature added to Java 1.3. As you may know, the Proxy Pattern is nothing more than providing implementation through indirection. Essentially, a class can implement an interface and, rather than contain any real logic or computation, it can just redirect calls to another object — hence the name proxy. A dynamic proxy is the same thing. The only difference being that the proxy implementation is created at runtime. This is perfect for creating fake implementations of your services inside of unit tests.