### Question:
InheritedAnnotationMatcher extends ElementMatcher.Junction.AbstractBase<T> { public boolean matches(T target) { return matcher.matches(target.getInheritedAnnotations()); } InheritedAnnotationMatcher(ElementMatcher<? super AnnotationList> matcher); boolean matches(T target); @Override String toString();  }### Answer:
@Test public void testMatch() throws Exception { when(typeDescription.getInheritedAnnotations()).thenReturn(annotationList); when(annotationMatcher.matches(annotationList)).thenReturn(true); assertThat(new InheritedAnnotationMatcher<TypeDescription>(annotationMatcher).matches(typeDescription), is(true)); verify(annotationMatcher).matches(annotationList); verifyNoMoreInteractions(annotationMatcher); verify(typeDescription).getInheritedAnnotations(); verifyNoMoreInteractions(typeDescription); }
@Test public void testNoMatch() throws Exception { when(typeDescription.getInheritedAnnotations()).thenReturn(annotationList); when(annotationMatcher.matches(annotationList)).thenReturn(false); assertThat(new InheritedAnnotationMatcher<TypeDescription>(annotationMatcher).matches(typeDescription), is(false)); verify(annotationMatcher).matches(annotationList); verifyNoMoreInteractions(annotationMatcher); verify(typeDescription).getInheritedAnnotations(); verifyNoMoreInteractions(typeDescription); }