### Question:
SingleStreamDiffScriptWriter implements DiffScriptWriter { @Override public void flush() throws IOException { Preconditions.checkState(!(mBufferSize != 0 && mReusableChunk != null)); if (mBufferSize != 0) { writeByteBuffer(); } if (mReusableChunk != null) { writeReusableChunk(); } mOutputStream.flush(); } SingleStreamDiffScriptWriter(OutputStream outputStream, int maxNewByteChunkSize); @Override void writeByte(byte b); @Override void writeChunk(long chunkStart, int chunkLength); @Override void flush();  }### Answer:
@Test public void flush_flushesOutputStream() throws IOException { ByteArrayOutputStream mockOutputStream = mock(ByteArrayOutputStream.class); SingleStreamDiffScriptWriter diffScriptWriter = new SingleStreamDiffScriptWriter(mockOutputStream, MAX_CHUNK_SIZE_IN_BYTES); diffScriptWriter.flush(); verify(mockOutputStream).flush(); }