### Question:
JAXBObjectEntityProvider implements EntityProvider<Object> { @Override public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return type.isAnnotationPresent(XmlRootElement.class); } JAXBObjectEntityProvider(@Context Providers providers); @Override boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override Object readFrom(Class<Object> type,
                           Type genericType,
                           Annotation[] annotations,
                           MediaType mediaType,
                           MultivaluedMap<String, String> httpHeaders,
                           InputStream entityStream); @Override long getSize(Object t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType); @Override void writeTo(Object t,
                        Class<?> type,
                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream);  }### Answer:
@Test public void isWriteableForTypeAnnotatedWithXmlRootElement() throws Exception { assertTrue(writer.isWriteable(Book.class, null, null, null)); }
@Test public void isNotWriteableForTypeNotAnnotatedWithXmlRootElement() throws Exception { assertFalse(writer.isWriteable(String.class, null, null, null)); }