ApplicationProviderBinder extends ProviderBinder { @Override public List<ResponseFilter> getResponseFilters(String path) { ApplicationContext context = ApplicationContext.getCurrent(); List<ResponseFilter> filters = doGetMatchedFilters(path, responseFilters).stream() .map(factory -> (ResponseFilter)factory.getInstance(context)) .collect(toList()); filters.addAll(getDefaults().getResponseFilters(path)); return filters; }  @Override List<MediaType> getAcceptableWriterMediaTypes(Class<?> type, Type genericType, Annotation[] annotations); @Override ContextResolver<T> getContextResolver(Class<T> contextType, MediaType mediaType); @Override ExceptionMapper<T> getExceptionMapper(Class<T> type); @Override MessageBodyReader<T> getMessageBodyReader(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override MessageBodyWriter<T> getMessageBodyWriter(Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override List<MethodInvokerFilter> getMethodInvokerFilters(String path); @Override List<RequestFilter> getRequestFilters(String path); @Override List<ResponseFilter> getResponseFilters(String path);  }
@Test public void retrievesResponseFiltersByPath() { ResponseFilter embeddedResponseFilter = mock(ResponseFilter.class); when(embeddedProviders.getResponseFilters("/a")).thenReturn(newArrayList(embeddedResponseFilter)); PathMatchesResponseFilter pathMatchesResponseFilter = new PathMatchesResponseFilter(); AllMatchesResponseFilter allMatchesResponseFilter = new AllMatchesResponseFilter(); applicationProviders.addResponseFilter(pathMatchesResponseFilter); applicationProviders.addResponseFilter(allMatchesResponseFilter); assertEquals(newArrayList(allMatchesResponseFilter, embeddedResponseFilter), applicationProviders.getResponseFilters("/a")); }