### Question:
HttpHeaderInspectingApiRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest request) { return X_REQUESTED_WITH_HEADER_AJAX_VALUE.equals(request.getHeader(X_REQUESTED_WITH_HEADER)); }  @Override boolean matches(HttpServletRequest request);  }### Answer:
@Test public void testMatchesBrowserRequest() throws Exception { request.addHeader(HttpHeaders.ACCEPT, "application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"); assertFalse(apiRequestMatcher.matches(request)); }
@Test public void testMatchesRequestedWith() throws Exception { request.addHeader( HttpHeaderInspectingApiRequestMatcher.X_REQUESTED_WITH_HEADER, HttpHeaderInspectingApiRequestMatcher.X_REQUESTED_WITH_HEADER_AJAX_VALUE); assertTrue(apiRequestMatcher.matches(request)); }