### Question:
HasJsonPath extends TypeSafeMatcher<JsonNode> { @Override public void describeTo(Description description) { description.appendText("a JSON object matching JSONpath \"" + jsonPath + "\""); if (matcher != null) { description.appendText(" with "); matcher.describeTo(description); } } HasJsonPath(String jsonPath);  HasJsonPath(String jsonPath, Matcher<T> matcher); @Override boolean matchesSafely(JsonNode jsonNode); @Override void describeTo(Description description);  }### Answer:
@Test public void describeToDoesntThrowNPE() { hasJsonPath = new HasJsonPath<Object>("$.foo"); StringDescription sd = new StringDescription(); hasJsonPath.describeTo(sd); assertThat(sd.toString(), is("a JSON object matching JSONpath \"$.foo\"")); }