CompositeRecordReaderListener implements RecordReaderListener<P> { @Override public void afterRecordReading(Record<P> record) { for (ListIterator<RecordReaderListener<P>> iterator = listeners.listIterator(listeners.size()); iterator.hasPrevious();) { iterator.previous().afterRecordReading(record); } } CompositeRecordReaderListener();  CompositeRecordReaderListener(List<RecordReaderListener<P>> listeners); @Override void beforeRecordReading(); @Override void afterRecordReading(Record<P> record); @Override void onRecordReadingException(Throwable throwable); void addRecordReaderListener(RecordReaderListener<P> recordReaderListener);  }
@Test public void testAfterRecordReading() { compositeRecordReaderListener.afterRecordReading(record); InOrder inOrder = inOrder(recordReaderListener1, recordReaderListener2); inOrder.verify(recordReaderListener2).afterRecordReading(record); inOrder.verify(recordReaderListener1).afterRecordReading(record); }