1. Features
With Amock, you
Can mock static method and constructor.
- You can unit test with singleton.
Can create mock object of a class which have only private constructor.
Can create mock instance of interface and normal class instance.
Can create mock object without any parameter even if the class does not have default constructor.
- You don’t need to create expensive object just for mock constructor.
Can access private method and attribute easily.
Can mock private and protected method.
Can use argument checker (argument matcher 'eq(). any()...') only where it is needed.
Can change final variable.
Can change String value.
Don’t need extending specific class.

2. Setup environment
2.1. Prerequisite
JDK 1.5 version
http://java.sun.com/javase/downloads/index_jdk5.jspDownload Amock libarary and documentation from
and CGlib no dependency 2.1_3
With Amock, You can
- mock static method and constructor.
- mock private method.
- create mock instance of private constructor class, interface and of course normal class instance.
- create mock instance without any parameter input when class have only parameter constructor.
- access private method and attribute easily.
- use argument checker (argument matcher 'eq(). any()...') only where it is needed.
...
All you need to do is install aspectj eviroment and add Amock library to aspect path and class path.
It is FREE !
Download here
http://www.box.net/shared/2r5pkpkzpi