### Question:
MethodParameterFilterChain implements MethodParameterFilter { public boolean matches(NativeWebRequest request, MethodParameter methodParameter) { if (this.filters != null) { for (MethodParameterFilter filter : this.filters) { if (filter.matches(request, methodParameter)) { return true; } } } return false; } MethodParameterFilterChain(MethodParameterFilter... filters); boolean matches(NativeWebRequest request, MethodParameter methodParameter);  }### Answer:
@Test public void shouldWorkWithNullChain() throws Exception { MethodParameterFilterChain c = new MethodParameterFilterChain((MethodParameterFilter[]) null); assertThat(c.matches(this.request, this.methodParameter), is(false)); }
@Test public void shouldCallChainStopingAtFirstFiltered() throws Exception { MethodParameterFilter f1 = mock(MethodParameterFilter.class); MethodParameterFilter f2 = mock(MethodParameterFilter.class); MethodParameterFilter f3 = mock(MethodParameterFilter.class); given(f2.matches(this.request, this.methodParameter)).willReturn(true); MethodParameterFilterChain c = new MethodParameterFilterChain(f1, f2, f3); assertThat(c.matches(this.request, this.methodParameter), is(true)); InOrder ordered = inOrder(f1, f2, f3); ordered.verify(f1).matches(this.request, this.methodParameter); ordered.verify(f2).matches(this.request, this.methodParameter); ordered.verify(f3, never()).matches(this.request, this.methodParameter); }