hamcrest/JavaHamcrest — pull request #1 by scarytom (2012-04-05 10:19:24+00:00)
Title: Introduce MatcherMatcher, a hamcrest matcher for matchers

Hi Steve, Tom Denley here.

Now that you have transitioned hamcrest onto github, I thought I'd try to contribute some of our work at youDevise back into hamcrest, starting with the MatcherMatcher. This is a hamcrest matcher for hamcrest matchers, which facilitates test-driven development of new matcher implementations.

The MatcherMatcher allows for three assertions to be made against a matcher implementation:

assertThat(myFooMatcher, is(aMatcherWithDescription(equalTo("a Foo"))));
assertThat(myFooMatcher, is(aMatcherThatMatches(new Foo())));
assertThat(myFooMatcher, is(aMatcherGivingAMismatchDesctiptionOf(new Bar(), equalTo("was a Bar"))));