Although Hamcrest 1.2 comes with a large library of matchers, sometimes these do not let you specify an assertion or expectation accurately enough to convey what you mean or to keep your tests flexible. In such cases, you can easily define a new matcher that seamlessly extends the JUnit and jMock APIs.
A matcher is an object that implements the
A matcher does two things:
• Reports whether a parameter value meets the constraint (the
• Generates a readable description to be included in test failure messages (the
describeTo() method inherited ...