CompositeRecordWriter implements RecordWriter<P> { @Override public void close() throws Exception { for (RecordWriter<P> writer : writers) { writer.close(); } } CompositeRecordWriter(List<RecordWriter<P>> writers); @Override void open(); @Override void writeRecords(Batch<P> batch); @Override void close();  }
@Test public void testClose() throws Exception { compositeRecordWriter.close(); InOrder inOrder = inOrder(recordWriter1, recordWriter2); inOrder.verify(recordWriter1).close(); inOrder.verify(recordWriter2).close(); }