FinalizeFlusher implements OdsAsyncFlusher { @Override public void flushInto(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException { this.contentElement.writePostamble(xmlUtil, writer); this.odsElements.writeSettings(xmlUtil, writer); this.odsElements.writeExtras(xmlUtil, writer); writer.finish(); writer.close(); } FinalizeFlusher(final ContentElement contentElement, final OdsElements odsElements); @Override void flushInto(final XMLUtil xmlUtil, final ZipUTF8Writer writer); @Override boolean isEnd();  }
@Test public final void test() throws IOException { final XMLUtil util = XMLUtil.create(); final ContentElement contentElement = PowerMock.createMock(ContentElement.class); final OdsElements odsElements = PowerMock.createMock(OdsElements.class); final ZipUTF8Writer w = PowerMock.createMock(ZipUTF8Writer.class); PowerMock.resetAll(); contentElement.writePostamble(util, w); odsElements.writeSettings(util, w); odsElements.writeExtras(util, w); w.finish(); w.close(); PowerMock.replayAll(); final OdsAsyncFlusher flusher = new FinalizeFlusher(contentElement, odsElements); flusher.flushInto(util, w); PowerMock.verifyAll(); }