### Question:
PiazzaConfiguration { void writeElementTo(Element element, Writer writer) throws IOException { try { XMLOutputter outputter = new XMLOutputter(); outputter.output(element, writer); writer.close(); } finally { IOUtils.closeQuietly(writer); } } PiazzaConfiguration(@NotNull ServerPaths serverPaths); synchronized void save(); boolean isShowOnFailureOnly(); void setShowOnFailureOnly(boolean showOnFailureOnly); void setTeamCityConfigDir(@NotNull String teamCityConfigDir); void setMaxPortraitSize(int maxPortraitSize); int getMaxPortraitSize();  }### Answer:
@Test public void testWriteElementTo() throws IOException { Element element = new Element("piazza"); element.setAttribute("testAttribute", "testValue"); StringWriter stringWriter = new StringWriter(); piazzaConfiguration.writeElementTo(element, stringWriter); assertEquals("<piazza testAttribute=\"testValue\" />", stringWriter.toString()); }