SAXSourceEntityProvider implements EntityProvider<SAXSource> { @Override public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return SAXSource.class.isAssignableFrom(type); }  @Override boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override SAXSource readFrom(Class<SAXSource> type,
                              Type genericType,
                              Annotation[] annotations,
                              MediaType mediaType,
                              MultivaluedMap<String, String> httpHeaders,
                              InputStream entityStream); @Override long getSize(SAXSource t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override void writeTo(SAXSource saxSource,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream);  }
@Test public void isWritableForSAXSource() throws Exception { assertTrue(saxSourceEntityProvider.isWriteable(SAXSource.class, null, null, APPLICATION_XML_TYPE)); }
@Test public void isNotWritableForTypeOtherThanSAXSource() throws Exception { assertFalse(saxSourceEntityProvider.isWriteable(DOMSource.class, null, null, APPLICATION_XML_TYPE)); }