### Question:
IndentingXMLStreamWriter implements XMLStreamWriter { @Override public void writeNamespace(final String prefix, final String namespaceURI) throws XMLStreamException { next.writeNamespace(prefix, namespaceURI); } IndentingXMLStreamWriter(final XMLStreamWriter next); @Override void close(); @Override void flush(); @Override NamespaceContext getNamespaceContext(); @Override String getPrefix(final String uri); @Override Object getProperty(final String name); @Override void setDefaultNamespace(final String uri); @Override void setNamespaceContext(final NamespaceContext context); @Override void setPrefix(final String prefix, final String uri); @Override void writeAttribute(final String localName, final String value); @Override void writeAttribute(final String namespaceURI, final String localName, final String value); @Override void writeAttribute(final String prefix, final String namespaceURI, final String localName,
            final String value); @Override void writeCData(final String data); @Override void writeCharacters(final String text); @Override void writeCharacters(final char[] text, final int start, final int len); @Override void writeComment(final String data); @Override void writeDTD(final String dtd); @Override void writeDefaultNamespace(final String namespaceURI); @Override void writeEmptyElement(final String localName); @Override void writeEmptyElement(final String namespaceURI, final String localName); @Override void writeEmptyElement(final String prefix, final String localName, final String namespaceURI); @Override void writeEndDocument(); @Override void writeEndElement(); @Override void writeEntityRef(final String name); @Override void writeNamespace(final String prefix, final String namespaceURI); @Override void writeProcessingInstruction(final String target); @Override void writeProcessingInstruction(final String target, final String data); @Override void writeStartDocument(); @Override void writeStartDocument(final String version); @Override void writeStartDocument(final String encoding, final String version); @Override void writeStartElement(final String localName); @Override void writeStartElement(final String namespaceURI, final String localName); @Override void writeStartElement(final String prefix, final String localName, final String namespaceURI);  }### Answer:
@Test public void testWriteNamespace() throws IOException, XMLStreamException { out.writeStartElement("element1"); out.writeDefaultNamespace(DEFAULT_NAMESPACE); out.writeEndElement(); assertOutput("<element1 xmlns=\"" + DEFAULT_NAMESPACE + "\"></element1>"); out.writeStartElement("element2"); out.writeNamespace(PREFIX, NAMESPACE); out.writeEndElement(); assertOutput("<element2 xmlns:" + PREFIX + "=\"" + NAMESPACE + "\"></element2>"); }