jMock 2 is a library for testing Java code using mock objects. Mock objects help you design and test the interactions between the objects in your programs.

jMock 2:

More information can be found on the jMock website (www.jmock.org).