SpecobjectExporter implements Exporter { @Override public void runExport() { try { writeOutput(); } catch (final XMLStreamException e) { throw new ExporterException("Error exporting to specobject format", e); } finally { closeXmlWriter(); } } SpecobjectExporter(final Stream<SpecificationItem> itemStream,
            final XMLStreamWriter xmlWriter, final Writer originalWriter, final Newline newline); @Override // [impl->dsn~conversion.reqm2-export~1] void runExport();  }
@Test void testExportClosesWriters() throws XMLStreamException, IOException { final XMLStreamWriter xmlWriterMock = mock(XMLStreamWriter.class); final Writer writerMock = mock(Writer.class); new SpecobjectExporter(Stream.empty(), xmlWriterMock, writerMock, Newline.UNIX).runExport(); final InOrder inOrder = inOrder(xmlWriterMock, writerMock); inOrder.verify(xmlWriterMock).close(); inOrder.verify(writerMock).close(); inOrder.verifyNoMoreInteractions(); }