ProteinWriter { public void close() throws IOException { writer.close(); } ProteinWriter(Writer writer, String documentText); Writer getFileWriter(); void setFileWriter(Writer writer); void writeProtein(Gene protein); void close(); boolean isWritten(Gene protein);  }
@Test public void testClose() throws IOException{ writer.close(); replay(writer); proteinWriter.close(); verify(writer); }