### Question:
VisibilityMatcher extends ElementMatcher.Junction.AbstractBase<T> { public boolean matches(T target) { return target.isVisibleTo(typeDescription); } VisibilityMatcher(TypeDescription typeDescription); boolean matches(T target); @Override String toString();  }### Answer:
@Test public void testMatch() throws Exception { when(byteCodeElement.isVisibleTo(typeDescription)).thenReturn(true); assertThat(new VisibilityMatcher<ByteCodeElement>(typeDescription).matches(byteCodeElement), is(true)); verify(byteCodeElement).isVisibleTo(typeDescription); verifyNoMoreInteractions(byteCodeElement); verifyZeroInteractions(typeDescription); }
@Test public void testNoMatch() throws Exception { when(byteCodeElement.isVisibleTo(typeDescription)).thenReturn(false); assertThat(new VisibilityMatcher<ByteCodeElement>(typeDescription).matches(byteCodeElement), is(false)); verify(byteCodeElement).isVisibleTo(typeDescription); verifyNoMoreInteractions(byteCodeElement); verifyZeroInteractions(typeDescription); }