@Test
public void imgTagTest() throws Exception {

    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
    XHTMLContentHandler xhtml = new XHTMLContentHandler(
            new RichTextContentHandler(
                new OutputStreamWriter(buffer, Charset.defaultCharset())),
            new Metadata());
    xhtml.startDocument();
    AttributesImpl attributes = new AttributesImpl();
    attributes.addAttribute("", "", "alt", "", "value");
    xhtml.startElement("img", attributes);
    xhtml.endDocument();
    assertEquals("\n\n\n\n[image: value]", buffer.toString(UTF_8.name()));
}