### Question:
IsNamedMatcher extends ElementMatcher.Junction.AbstractBase<T> { public boolean matches(T target) { return target.isNamed(); }  boolean matches(T target); @Override String toString();  }### Answer:
@Test public void testMatch() throws Exception { when(namedElement.isNamed()).thenReturn(true); assertThat(new IsNamedMatcher<NamedElement.WithOptionalName>().matches(namedElement), is(true)); }
@Test public void testPositiveToNegative() throws Exception { assertThat(new IsNamedMatcher<NamedElement.WithOptionalName>().matches(namedElement), is(false)); }