### Question:
HtmlExtensionDocWriter implements ExtensionDocWriter { @Override public void write(final ExtensionMetadata extensionMetadata, final Extension extension, final OutputStream outputStream) throws IOException { try { final XMLStreamWriter xmlStreamWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(outputStream, "UTF-8"); xmlStreamWriter.writeDTD("<!DOCTYPE html>"); xmlStreamWriter.writeStartElement("html"); xmlStreamWriter.writeAttribute("lang", "en"); writeHead(extensionMetadata, xmlStreamWriter); writeBody(extensionMetadata, extension, xmlStreamWriter); xmlStreamWriter.writeEndElement(); xmlStreamWriter.close(); outputStream.flush(); } catch (XMLStreamException | FactoryConfigurationError e) { throw new IOException("Unable to create XMLOutputStream", e); } }  @Override void write(final ExtensionMetadata extensionMetadata, final Extension extension, final OutputStream outputStream);  }### Answer:
@Test public void testWriteDocsForConsumeKafkaRecord() throws IOException { final File rawExtensionJson = new File("src/test/resources/extensions/ConsumeKafkaRecord_1_0.json"); final String serializedExtension = getSerializedExtension(rawExtensionJson); final ExtensionEntity entity = new ExtensionEntity(); entity.setContent(serializedExtension); entity.setBucketId(UUID.randomUUID().toString()); entity.setBucketName("My Bucket"); entity.setGroupId("org.apache.nifi"); entity.setArtifactId("nifi-kakfa-bundle"); entity.setVersion("1.9.1"); entity.setSystemApiVersion("1.9.1"); entity.setBundleId(UUID.randomUUID().toString()); entity.setBundleType(BundleType.NIFI_NAR); entity.setDisplayName("ConsumeKafkaRecord_1_0"); final ExtensionMetadata metadata = ExtensionMappings.mapToMetadata(entity, extensionSerializer); assertNotNull(entity); final Extension extension = ExtensionMappings.map(entity, extensionSerializer); assertNotNull(extension); final ByteArrayOutputStream out = new ByteArrayOutputStream(); docWriter.write(metadata, extension, out); final String docsResult = new String(out.toByteArray(), StandardCharsets.UTF_8); assertNotNull(docsResult); XmlValidator.assertXmlValid(docsResult); XmlValidator.assertContains(docsResult, entity.getDisplayName()); }