I've written the following JUnit test, which uses [`ArgumentMatchers`](https://mockito.googlecode.com/svn/branches/1.6/javadoc/org/mockito/ArgumentMatcher.html).

```
    MyClass classUnderTest = new MyClass();

    class AnyBooleanMatcher extends ArgumentMatcher<Boolean> {
        public boolean matches(Object argument) {
            return ((Boolean) argument).equals(Boolean.TRUE);
        }
    }

    class MyObjectMatcher extends ArgumentMatcher<MyObject> {
        public boolean matches(Object argument) {
            return ((MyObject) argument).getValue().equals("123");
        }
    }

    final Service mockService = mock(Service.class);

    when(mockService.search(Matchers.argThat(new MyObjectMatcher()),
            Matchers.argThat(new AnyBooleanMatcher())));

    classUnderTest.callMethod(mock(ActionEvent.class));

    verify(mockService).search(Matchers.argThat(new MyObjectMatcher()),
            Matchers.argThat(new AnyBooleanMatcher()));

```

Unfortunately I'm always getting a `NullPointerException`, at the `when` statement. 

I even know why: [`argThat`](https://mockito.googlecode.com/svn/branches/1.5/javadoc/org/mockito/Matchers.html#argThat%28org.hamcrest.Matcher%29) returns `null`, as specified in the JavaDoc. But I don't know why my test won't work, when the ones in the [example](https://mockito.googlecode.com/svn/branches/1.6/javadoc/org/mockito/ArgumentMatcher.html) - which are modelled in exactly the same way - do work.