TableAppender { public void appendXMLToContentEntry(final XMLUtil util, final Appendable appendable) throws IOException { this.appendPreamble(util, appendable); this.appendRows(util, appendable); this.appendPostamble(appendable); } TableAppender(final TableBuilder builder); void appendXMLToContentEntry(final XMLUtil util, final Appendable appendable); void appendPostamble(final Appendable appendable); void appendPreambleOnce(final XMLUtil util, final Appendable appendable); void appendPreamble(final XMLUtil util, final Appendable appendable); void appendAllAvailableRows(final XMLUtil util, final Appendable appendable); void appendRemainingRowsFrom(final XMLUtil util, final Appendable appendable,
                                        final int rowIndex); void appendSomeAvailableRowsFrom(final XMLUtil util, final Appendable appendable,
                                            final int rowIndex); boolean isPreambleWritten();  }
@Test public final void testAppendTwoWriters() throws IOException { final StringBuilder sb1 = new StringBuilder(); final StringBuilder sb2 = new StringBuilder(); final FastFullList<TableColumnImpl> emptyFullList = FastFullList.<TableColumnImpl>builder().build(); PowerMock.resetAll(); EasyMock.expect(this.tb.getName()).andReturn("tb").times(2); EasyMock.expect(this.tb.getStyleName()).andReturn("tb-style").times(2); EasyMock.expect(this.tb.getCustomValueByAttribute()).andReturn(null).times(2); EasyMock.expect(this.tb.getColumns()).andReturn(emptyFullList).times(2); EasyMock.expect(this.tb.getTableRowsUsedSize()).andReturn(0).times(2); EasyMock.expect(this.tb.getShapes()).andReturn(Collections.<Shape>emptyList()).times(2); PowerMock.replayAll(); this.tableAppender.appendXMLToContentEntry(this.xmlUtil, sb1); this.tableAppender.appendXMLToContentEntry(this.xmlUtil, sb2); PowerMock.verifyAll(); DomTester.assertEquals(sb1.toString(), sb2.toString()); }