ContentElement implements OdsElement { @Override public void write(final XMLUtil util, final ZipUTF8Writer writer) throws IOException { this.writePreamble(util, writer); for (final Table table : this.tables) { table.appendXMLContent(util, writer); } this.writePostamble(util, writer); } ContentElement(final PositionUtil positionUtil, final XMLUtil xmlUtil,
                   final WriteUtil writeUtil, final DataStyles format,
                   final boolean libreOfficeMode, final StylesContainerImpl stylesContainer,
                   final Map<String, String> additionalNamespaceByPrefix); TableCellStyle addChildCellStyle(final TableCellStyle style, final CellType type); @Deprecated Table addTable(final String name, final int rowCapacity, final int columnCapacity); boolean addTable(final Table table); Table createTable(final String name, final int rowCapacity, final int columnCapacity); Table getLastTable(); StylesContainer getStyleTagsContainer(); Table getTable(final int tableIndex); Table getTable(final String name); int getTableCount(); List<Table> getTables(); @Override void write(final XMLUtil util, final ZipUTF8Writer writer); void writePreamble(final XMLUtil util, final ZipUTF8Writer writer); void writePostamble(final XMLUtil util, final ZipUTF8Writer writer); void writeEvents(final XMLUtil util, final ZipUTF8Writer writer); void addAutoFilter(final AutoFilter autoFilter); void addEvents(final ScriptEventListener... events); void addPilotTable(final PilotTable pilotTable);  }
@Test public void testWrite() throws IOException { final ZipUTF8WriterMockHandler handler = ZipUTF8WriterMockHandler.create(); final ZipUTF8Writer writer = handler.getInstance(ZipUTF8Writer.class); PowerMock.resetAll(); this.container .writeFontFaceDecls(EasyMock.eq(this.xmlUtil), EasyMock.isA(Appendable.class)); this.container .writeHiddenDataStyles(EasyMock.eq(this.xmlUtil), EasyMock.isA(Appendable.class)); this.container.writeContentAutomaticStyles(EasyMock.eq(this.xmlUtil), EasyMock.isA(Appendable.class)); PowerMock.replayAll(); final Table t = this.createTable("t", 100, 100); this.content.addTable(t); this.content.write(this.xmlUtil, writer); DomTester.assertEquals(PREAMBLE_BODY + "<office:spreadsheet>" + "<table:table table:name=\"t\" table:style-name=\"ta1\" table:print=\"false\"><office:forms form:automatic-focus=\"false\" form:apply-design-mode=\"false\"/><table:table-column table:style-name=\"co1\" table:number-columns-repeated=\"1024\" table:default-cell-style-name=\"Default\"/></table:table>" + "</office:spreadsheet>" + POSTAMBLE_BODY, this.getString(handler)); }