}
@Test
public void testWriteDataSourceWithDiffCT() throws Exception {
DataSourceProvider<DataSource> p = new DataSourceProvider<DataSource>();
DataSource ds = new InputStreamDataSource(new ByteArrayInputStream("image".getBytes()),
"image/png");
ByteArrayOutputStream os = new ByteArrayOutputStream();
MultivaluedMap<String, Object> outHeaders = new MetadataMap<String, Object>();
p.writeTo(ds, DataSource.class, DataSource.class, new Annotation[]{},
MediaType.valueOf("image/bar"), outHeaders, os);