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