### Question:
HtmlDocumentBuilder extends AbstractXmlDocumentBuilder { public void setElementNameOfSpanType(SpanType spanType, String elementName) { checkNotNull(spanType, "Must provide spanType"); checkNotNull(elementName, "Must provide elementName"); ImmutableMap.Builder<SpanType, String> builder = ImmutableMap.builder(); for (Entry<SpanType, String> entry : spanTypeToElementName.entrySet()) { if (!entry.getKey().equals(spanType)) { builder.put(entry); } } builder.put(spanType, elementName); spanTypeToElementName = builder.build(); } HtmlDocumentBuilder(Writer out);  HtmlDocumentBuilder(Writer out, boolean formatting);  HtmlDocumentBuilder(XmlStreamWriter writer); void copyConfiguration(HtmlDocumentBuilder other); void setElementNameOfSpanType(SpanType spanType, String elementName); String getHtmlNsUri(); void setHtmlNsUri(String htmlNsUri); String getHtmlDtd(); void setHtmlDtd(String htmlDtd); boolean isEmitAsDocument(); void setEmitAsDocument(boolean emitAsDocument); boolean isEmitDtd(); void setEmitDtd(boolean emitDtd); String getEncoding(); void setEncoding(String encoding); String getTitle(); void setTitle(String title); String getDefaultAbsoluteLinkTarget(); void setDefaultAbsoluteLinkTarget(String defaultAbsoluteLinkTarget); boolean isXhtmlStrict(); void setXhtmlStrict(boolean xhtmlStrict); @Deprecated void addCssStylesheet(String url); @Deprecated void addCssStylesheet(File file); void addCssStylesheet(Stylesheet stylesheet); boolean isUseInlineStyles(); void setUseInlineStyles(boolean useInlineStyles); boolean isSuppressBuiltInStyles(); void setSuppressBuiltInStyles(boolean suppressBuiltInStyles); String getLinkRel(); void setLinkRel(String linkRel); void setDocumentHandler(HtmlDocumentHandler documentHandler); @Override void beginDocument(); @Override void endDocument(); @Override void entityReference(String entity); @Override void acronym(String text, String definition); @Override void link(Attributes attributes, String hrefOrHashName, String text); @Override void beginBlock(BlockType type, Attributes attributes); @Override void beginHeading(int level, Attributes attributes); @Override void beginSpan(SpanType type, Attributes attributes); @Override void endBlock(); @Override void endHeading(); @Override void endSpan(); @Override void image(Attributes attributes, String url); @Override void imageLink(Attributes linkAttributes, Attributes imageAttributes, String href, String imageUrl); String getHtmlFilenameFormat(); void setHtmlFilenameFormat(String htmlFilenameFormat); @Override void lineBreak(); @Override void horizontalRule(); @Override void charactersUnescaped(String literal); void setPrependImagePrefix(String prependImagePrefix); String getPrependImagePrefix(); boolean isFilterEntityReferences(); void setFilterEntityReferences(boolean filterEntityReferences); String getCopyrightNotice(); void setCopyrightNotice(String copyrightNotice);  }### Answer:
@Test public void setElementNameOfSpanType() { builder.setElementNameOfSpanType(SpanType.BOLD, "new-bold"); builder.setElementNameOfSpanType(SpanType.LINK, "new-a"); assertElementNameOfSpanType(out, builder); StringWriter out2 = new StringWriter(); HtmlDocumentBuilder builder2 = new HtmlDocumentBuilder(out2); builder.copyConfiguration(builder2); assertElementNameOfSpanType(out2, builder2); }
@Test public void setElementNameOfSpanTypeRequiresSpanType() { thrown.expect(NullPointerException.class); thrown.expectMessage("Must provide spanType"); builder.setElementNameOfSpanType(null, "some-name"); }
@Test public void setElementNameOfSpanTypeRequiresElementName() { thrown.expect(NullPointerException.class); thrown.expectMessage("Must provide elementName"); builder.setElementNameOfSpanType(SpanType.BOLD, null); }