EndTableFlusher implements OdsAsyncFlusher { @Override public void flushInto(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException { for (final TableRowImpl row : this.rows) { TableRowImpl.appendXMLToTable(row, xmlUtil, writer); } Collections.fill(this.rows, null); this.appender.appendPostamble(writer); } EndTableFlusher(final TableAppender appender, final List<TableRowImpl> rows); @Override void flushInto(final XMLUtil xmlUtil, final ZipUTF8Writer writer); @Override boolean isEnd();  }
@Test public void flushIntoEmptytList() throws Exception { final List<TableRowImpl> rows = Collections.emptyList(); PowerMock.resetAll(); this.appender.appendPostamble(this.w); PowerMock.replayAll(); final OdsAsyncFlusher f = new EndTableFlusher(this.appender, rows); f.flushInto(this.util, this.w); PowerMock.verifyAll(); }
@Test public void flushInto() throws Exception { final TableRowImpl r1 = PowerMock.createMock(TableRowImpl.class); final TableRowImpl r2 = PowerMock.createMock(TableRowImpl.class); final List<TableRowImpl> rows = Arrays.asList(r1, r2); PowerMock.resetAll(); r1.appendXMLToTable(this.util, this.w); r2.appendXMLToTable(this.util, this.w); this.appender.appendPostamble(this.w); PowerMock.replayAll(); final OdsAsyncFlusher f = new EndTableFlusher(this.appender, rows); f.flushInto(this.util, this.w); PowerMock.verifyAll(); }