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