DataSourceEntityProvider implements EntityProvider<DataSource> { @Override public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return DataSource.class.isAssignableFrom(type); }  @Override boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override DataSource readFrom(Class<DataSource> type,
                               Type genericType,
                               Annotation[] annotations,
                               MediaType mediaType,
                               MultivaluedMap<String, String> httpHeaders,
                               InputStream entityStream); @Override long getSize(DataSource dataSource, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override void writeTo(DataSource dataSource,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream);  }
@Test public void isWritableForDataSource() throws Exception { assertTrue(dataSourceEntityProvider.isWriteable(DataSource.class, null, null, null)); }
@Test public void isNotWritableForTypeOtherThanDataSource() throws Exception { assertFalse(dataSourceEntityProvider.isWriteable(String.class, null, null, null)); }