EntityWriter { public void close() throws IOException { writer.close(); } EntityWriter(Writer writer, String documentText); Writer getFileWriter(); void setFileWriter(Writer writer); void writeEntity(EntityMention entity); void close(); boolean isWritten(EntityMention entity);  }
@Test public void testClose() throws IOException{ writer.close(); replay(writer); entityWriter.close(); verify(writer); }