CompositeRecordReaderListener implements RecordReaderListener<P> { @Override public void onRecordReadingException(Throwable throwable) { for (ListIterator<RecordReaderListener<P>> iterator = listeners.listIterator(listeners.size()); iterator.hasPrevious();) { iterator.previous().onRecordReadingException(throwable); } } 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 testOnRecordReadingException() { compositeRecordReaderListener.onRecordReadingException(exception); InOrder inOrder = inOrder(recordReaderListener1, recordReaderListener2); inOrder.verify(recordReaderListener2).onRecordReadingException(exception); inOrder.verify(recordReaderListener1).onRecordReadingException(exception); }