StreamSourceEntityProvider implements EntityProvider<StreamSource> { @Override public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return StreamSource.class.isAssignableFrom(type); }  @Override boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override StreamSource readFrom(Class<StreamSource> type,
                                 Type genericType,
                                 Annotation[] annotations,
                                 MediaType mediaType,
                                 MultivaluedMap<String, String> httpHeaders,
                                 InputStream entityStream); @Override long getSize(StreamSource streamSource, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override void writeTo(StreamSource streamSource,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream);  }
@Test public void isWritableForStreamSource() throws Exception { assertTrue(streamSourceEntityProvider.isWriteable(StreamSource.class, null, null, APPLICATION_XML_TYPE)); }
@Test public void isNotWritableForTypeOtherThanStreamSource() throws Exception { assertFalse(streamSourceEntityProvider.isWriteable(DOMSource.class, null, null, APPLICATION_XML_TYPE)); }