ApplicationProviderBinder extends ProviderBinder { @Override public List<MediaType> getAcceptableWriterMediaTypes(Class<?> type, Type genericType, Annotation[] annotations) { List<MediaType> mediaTypes = doGetAcceptableWriterMediaTypes(type, genericType, annotations); mediaTypes.addAll(getDefaults().getAcceptableWriterMediaTypes(type, genericType, annotations)); return mediaTypes; }  @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 retrievesAcceptableWriterMediaTypesFromApplicationProviderBinderAndEmbeddedProviderBinder() throws Exception { when(embeddedProviders.getAcceptableWriterMediaTypes(String.class, null, null)).thenReturn(newArrayList(new MediaType("text", "xml"), new MediaType("application", "xml"))); ObjectFactory<ProviderDescriptor> applicationWriterFactory = mockStringWriterFactory(newArrayList(new MediaType("text", "*"), new MediaType("text", "plain"))); applicationProviders.addMessageBodyWriter(applicationWriterFactory); assertEquals(newArrayList(new MediaType("text", "plain"), new MediaType("text", "*"), new MediaType("text", "xml"), new MediaType("application", "xml")), applicationProviders.getAcceptableWriterMediaTypes(String.class, null, null)); }