@Test
public void testOutputStream() throws IOException {

  String baseline = TestFileUtils.getTestInputFile(testdataDirectory, "baseline", "outputstream.cxtm");
  File out = TestFileUtils.getTestOutputFile(testdataDirectory, "out", "outputstream.cxtm");
  FileOutputStream outs = new FileOutputStream(out);
  new CanonicalXTMWriter(outs).write(topicmap);
  outs.close();
  Assert.assertTrue("OutputStream export gives incorrect output",
             TestFileUtils.compareFileToResource(out, baseline));
}