OdsFactory { public OdsFileWriterAdapter createWriterAdapter(final File file) throws IOException { final NamedOdsDocument document = this.createNamedDocument(); final ZipUTF8WriterBuilderImpl zipUTF8Writer = ZipUTF8WriterImpl.builder().noWriterBuffer(); final OdsFileWriterAdapter writerAdapter = OdsFileWriterAdapter.create(this.logger, OdsFileDirectWriter.builder(this.logger, document).file(file) .zipBuilder(zipUTF8Writer).build()); document.addObserver(writerAdapter); document.prepare(); return writerAdapter; } OdsFactory(final Logger logger, final PositionUtil positionUtil, final WriteUtil writeUtil,
               final XMLUtil xmlUtil, final Map<String, String> additionalNamespaceByPrefix,
               final DataStyles format, final boolean libreOfficeMode,
               final MetaElement metaElement); static OdsFactoryBuilder builder(final Logger logger, final Locale locale); static OdsFactory create(); static OdsFactory create(final Logger logger, final Locale locale); @Deprecated OdsFactory dataStyles(final DataStyles ds); @Deprecated OdsFactory noLibreOfficeMode(); @Deprecated OdsFactory metaElement(final MetaElement metaElement); @Deprecated OdsFactory addNamespaceByPrefix(final Map<String, String> additionalNamespaceByPrefix); AnonymousOdsFileWriter createWriter(); NamedOdsFileWriter createWriter(final String filename); NamedOdsFileWriter createWriter(final File file); OdsFileWriterAdapter createWriterAdapter(final File file);  }
@Test public void createWriterAdapter() throws Exception { final Capture<String> msgCapture = Capture.newInstance(); PowerMock.resetAll(); this.logger.fine(EasyMock.capture(msgCapture)); PowerMock.replayAll(); this.odsFactory.createWriterAdapter(this.file); PowerMock.verifyAll(); Assert.assertTrue(msgCapture.getValue().startsWith("Add new flusher")); }