### Question:
HtmlLanguage extends MarkupLanguage { @Override public DocumentBuilder createDocumentBuilder(Writer out, boolean formatting) { return new HtmlDocumentBuilder(out, formatting); } HtmlLanguage(); boolean isParseCleansHtml(); void setParseCleansHtml(boolean parseCleansHtml); @Override void processContent(MarkupParser parser, String markupContent, boolean asDocument); @Override DocumentBuilder createDocumentBuilder(Writer out, boolean formatting); static HtmlLanguageBuilder builder(); @Override HtmlLanguage clone();  }### Answer:
@Test public void newDocumentBuilder() { Writer out = new StringWriter(); DocumentBuilder builder = new HtmlLanguage().createDocumentBuilder(out); assertNotNull(builder); assertTrue(builder instanceof HtmlDocumentBuilder); }
@Test public void newDocumentBuilderIsFormatting() { Writer out = new StringWriter(); DocumentBuilder builder = new HtmlLanguage().createDocumentBuilder(out, true); builder.beginDocument(); builder.beginBlock(BlockType.PARAGRAPH, new Attributes()); builder.characters("test"); builder.endBlock(); builder.endDocument(); assertEquals(loadResourceContent("newDocumentBuilderIsFormatting.xml"), out.toString()); }
@Test public void newDocumentBuilderIsNotFormatting() { Writer out = new StringWriter(); DocumentBuilder builder = new HtmlLanguage().createDocumentBuilder(out, false); builder.beginDocument(); builder.beginBlock(BlockType.PARAGRAPH, new Attributes()); builder.characters("test"); builder.endBlock(); builder.endDocument(); assertEquals(loadResourceContent("newDocumentBuilderIsNotFormatting.xml"), out.toString()); }