@Test
public void testWriteXml() throws IOException {

  Configuration conf = new Configuration();
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  conf.writeXml(baos);
  String result = baos.toString();
  assertTrue("Result has proper header", result.startsWith(XMLHEADER));
  assertTrue("Result has proper footer", result.endsWith("</configuration>"));
}