### Question:
Jaxb2RootElementHttpMessageConverter extends AbstractJaxb2HttpMessageConverter<Object> { @Override public boolean canWrite(Class<?> clazz, MediaType mediaType) { return (AnnotationUtils.findAnnotation(clazz, XmlRootElement.class) != null && canWrite(mediaType)); }  void setProcessExternalEntities(boolean processExternalEntities); boolean isProcessExternalEntities(); @Override boolean canRead(Class<?> clazz, MediaType mediaType); @Override boolean canWrite(Class<?> clazz, MediaType mediaType);  }### Answer:
@Test public void canWrite() throws Exception { assertTrue("Converter does not support writing @XmlRootElement", converter.canWrite(RootElement.class, null)); assertTrue("Converter does not support writing @XmlRootElement subclass", converter.canWrite(RootElementSubclass.class, null)); assertTrue("Converter does not support writing @XmlRootElement subclass", converter.canWrite(rootElementCglib.getClass(), null)); assertFalse("Converter supports writing @XmlType", converter.canWrite(Type.class, null)); }