### Question:
HasStatusCode extends TypeSafeMatcher<Response> { @Override protected void describeMismatchSafely(Response item, Description mismatchDescription) { mismatchDescription.appendText("Response has status code: " + item.getStatusCode()); } HasStatusCode(Matcher<Integer> statusCodeMatcher); @Override void describeTo(Description description);  }### Answer:
@Test public void mismatchResponseDescribesCorrectly() { when(response.getStatusCode()).thenReturn(200); when(response.getContent()).thenReturn(null); Description description = new StringDescription(); matcher.describeMismatchSafely(response, description); assertThat(description.toString(), is("Response has status code: 200")); }