### Question:
SourceProvider implements MessageBodyWriter<Source> { protected boolean isReadable(MediaType mediaType) { return MediaTypeUtils.isXmlType(mediaType); }  long getSize(Source t,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType); boolean isWriteable(Class<?> type,
                               Type genericType,
                               Annotation[] annotations,
                               MediaType mediaType); void writeTo(Source t,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream);  }### Answer:
@Test public void testJAXBUnmarshallingWithDTDServerConfigurable() throws Exception { final Properties props = new Properties(); props.put("wink.supportDTDEntityExpansion", "true"); checking(new Expectations() {{ allowing(winkConfiguration).getProperties(); will(returnValue(props)); }}); assertTrue(sourceProviderReader.isReadable(DOMSource.class, null, null, MediaType.TEXT_XML_TYPE)); ByteArrayInputStream bais = new ByteArrayInputStream(xmlWithDTD.getBytes()); Object obj = sourceProviderReader.readFrom(DOMSource.class, null, null, MediaType.TEXT_XML_TYPE, null, bais); assertTrue(obj instanceof DOMSource); }
@Test public void testStreamSourceProviderIsReadable() { SourceProvider.StreamSourceProvider sp = new SourceProvider.StreamSourceProvider(); assertTrue(sp.isReadable(Source.class, null, null, MediaType.APPLICATION_XML_TYPE)); assertTrue(sp.isReadable(StreamSource.class, null, null, MediaType.TEXT_XML_TYPE)); }