@Test
public void testWriter() throws IOException {

  String baseline = TestFileUtils.getTestInputFile(testdataDirectory, "baseline", "writer.cxtm");
  File out = TestFileUtils.getTestOutputFile(testdataDirectory, "out", "writer.cxtm");
  Writer outw = new OutputStreamWriter(new FileOutputStream(out), "utf-8");
  new CanonicalXTMWriter(outw).write(topicmap);
  outw.close();
  Assert.assertTrue("OutputStream export gives incorrect output",
             TestFileUtils.compareFileToResource(out, baseline));
}