ProteinWriter { public boolean isWritten(Gene protein) { return writtenIds.contains(protein.getId()); } ProteinWriter(Writer writer, String documentText); Writer getFileWriter(); void setFileWriter(Writer writer); void writeProtein(Gene protein); void close(); boolean isWritten(Gene protein);  }
@Test public void testIsWritten() throws Exception{ writer.write(PROTEIN_T3); replay(writer); assertFalse(proteinWriter.isWritten(protein1)); proteinWriter.writeProtein(protein1); assertTrue(proteinWriter.isWritten(protein1)); }