### Question:
DefaultXmlStreamWriter extends XmlStreamWriter { @Override public void writeComment(String data) { closeElement(); out.write("<!-- "); out.write(data); out.write(" -->"); } DefaultXmlStreamWriter(OutputStream out);  DefaultXmlStreamWriter(Writer out);  DefaultXmlStreamWriter(Writer out, char xmlHeaderQuoteChar); @Override void close(); @Override void flush(); @Override String getPrefix(String uri); @Override String getNamespaceURI(String prefix); Object getProperty(String name); @Override void setDefaultNamespace(String uri); @Override void setPrefix(String prefix, String uri); @Override void writeAttribute(String localName, String value); @Override void writeAttribute(String namespaceURI, String localName, String value); @Override void writeAttribute(String prefix, String namespaceURI, String localName, String value); @Override void writeCData(String data); @Override void writeCharacters(String text); void writeCharactersUnescaped(String text); @Override void writeLiteral(String literal); @Override void writeCharacters(char[] text, int start, int len); @Override void writeComment(String data); @Override void writeDTD(String dtd); @Override void writeDefaultNamespace(String namespaceURI); @Override void writeEmptyElement(String localName); @Override void writeEmptyElement(String namespaceURI, String localName); @Override void writeEmptyElement(String prefix, String localName, String namespaceURI); @Override void writeEndDocument(); @Override void writeEndElement(); @Override void writeEntityRef(String name); @Override void writeNamespace(String prefix, String namespaceURI); @Override void writeProcessingInstruction(String target); @Override void writeProcessingInstruction(String target, String data); @Override void writeStartDocument(); @Override void writeStartDocument(String version); @Override void writeStartDocument(String encoding, String version); @Override void writeStartElement(String localName); @Override void writeStartElement(String namespaceURI, String localName); @Override void writeStartElement(String prefix, String localName, String namespaceURI); char getXmlHeaderQuoteChar(); void setXmlHeaderQuoteChar(char xmlHederQuoteChar); @Deprecated char getXmlHederQuoteChar(); @Deprecated void setXmlHederQuoteChar(char xmlHederQuoteChar);  }### Answer:
@Test public void writeComment() { writer.writeStartDocument(); writer.writeEmptyElement("test"); writer.writeComment("some comment text"); assertXml("<?xml version='1.0' ?><test/><!-- some comment text -->"); }