AcceptParameterHttpPreprocessor processor = new AcceptParameterHttpPreprocessor(acceptParamName);
List<MediaType> expected = Arrays.asList(MediaType.TEXT_XML_TYPE, MediaType.TEXT_PLAIN_TYPE, MediaType.TEXT_HTML_TYPE, MediaType.APPLICATION_XHTML_XML_TYPE);
MockHttpRequest request = MockHttpRequest.get("foo?" + acceptParamName + "=" + expected.get(0) + "," + expected.get(1));
PreMatchContainerRequestContext context = new PreMatchContainerRequestContext(request);
request.accept(expected.get(2));
request.accept(expected.get(3));
processor.filter(context);