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