### Question:
QueryParamPresenceRequestMatcher implements RequestMatcher { @Override public boolean matches(HttpServletRequest httpServletRequest) { return param != null && httpServletRequest.getParameter(param) != null; } QueryParamPresenceRequestMatcher(String param); @Override boolean matches(HttpServletRequest httpServletRequest);  }### Answer:
@Test public void testDoesNotMatchWithoutQueryParameter() throws Exception { prepareRequest(HttpMethod.GET, ROOT_CONTEXT_PATH, "some/random/uri", Collections.EMPTY_MAP); assertFalse(matcher.matches(request)); }
@Test public void testMatchesWithValidParameter() throws Exception { prepareRequest(HttpMethod.GET, ROOT_CONTEXT_PATH, "some/random/uri", Collections.singletonMap(VALID_PARAMETER, (Object) "123")); assertTrue(matcher.matches(request)); }
@Test public void testDoesNotMatchWithInvalidParameter() throws Exception { prepareRequest(HttpMethod.GET, ROOT_CONTEXT_PATH, "some/random/uri", Collections.singletonMap("some_parameter", (Object) "123")); assertFalse(matcher.matches(request)); }