@Test(expectedExceptions = IOException.class, expectedExceptionsMessageRegExp = "Stream closed")
public void end_closes_writer() throws Exception {

  FileContextTestImpl fileContext = new FileContextTestImpl();
  new DAFileWriter(fileContext.getWriter()).end();
  fileContext.getWriter().append("toto"); // raises IOException
}