ApplicationProviderBinder extends ProviderBinder { @Override public List<MethodInvokerFilter> getMethodInvokerFilters(String path) { ApplicationContext context = ApplicationContext.getCurrent(); List<MethodInvokerFilter> filters = doGetMatchedFilters(path, invokerFilters).stream() .map(factory -> (MethodInvokerFilter)factory.getInstance(context)) .collect(toList()); filters.addAll(getDefaults().getMethodInvokerFilters(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 retrievesMethodInvokerFiltersByPath() { MethodInvokerFilter embeddedMethodInvokerFilter = mock(MethodInvokerFilter.class); when(embeddedProviders.getMethodInvokerFilters("/a")).thenReturn(newArrayList(embeddedMethodInvokerFilter)); PathMatchesMethodInvokerFilter pathMatchesMethodInvokerFilter = new PathMatchesMethodInvokerFilter(); AllMatchesMethodInvokerFilter allMatchesMethodInvokerFilter = new AllMatchesMethodInvokerFilter(); applicationProviders.addMethodInvokerFilter(pathMatchesMethodInvokerFilter); applicationProviders.addMethodInvokerFilter(allMatchesMethodInvokerFilter); assertEquals(newArrayList(allMatchesMethodInvokerFilter, embeddedMethodInvokerFilter), applicationProviders.getMethodInvokerFilters("/a")); }