ContentElement implements OdsElement { public void addPilotTable(final PilotTable pilotTable) { if (this.pilotTables == null) { this.pilotTables = new ArrayList<PilotTable>(); } this.pilotTables.add(pilotTable); } 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 testAddPilotTable() throws IOException { final ZipUTF8WriterMockHandler handler = ZipUTF8WriterMockHandler.create(); final ZipUTF8Writer writer = handler.getInstance(ZipUTF8Writer.class); final PilotTable pilot = PilotTable.builder("n", "s", "t", Collections.<String>emptyList()).build(); 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(); this.content.writePreamble(this.xmlUtil, writer); this.content.addPilotTable(pilot); this.content.writePostamble(this.xmlUtil, writer); PowerMock.verifyAll(); final String actual = this.getString(handler); DomTester.assertEquals(PREAMBLE_BODY + "<office:spreadsheet><table:data-pilot-tables><table:data-pilot-table table:name=\"n\" table:application-data=\"\" table:target-range-address=\"t\" table:show-filter-button=\"true\" table:drill-down-on-double-click=\"false\"><table:source-cell-range table:cell-range-address=\"s\"/></table:data-pilot-table></table:data-pilot-tables>" + "</office:spreadsheet>" + POSTAMBLE_BODY, actual); }