CompositeBatchListener implements BatchListener<P> { @Override public void afterBatchProcessing(Batch<P> batch) { for (ListIterator<BatchListener<P>> iterator = listeners.listIterator(listeners.size()); iterator.hasPrevious();) { iterator.previous().afterBatchProcessing(batch); } } CompositeBatchListener();  CompositeBatchListener(List<BatchListener<P>> listeners); @Override void beforeBatchReading(); @Override void afterBatchProcessing(Batch<P> batch); @Override void afterBatchWriting(Batch<P> batch); @Override void onBatchWritingException(Batch<P> batch, Throwable throwable); void addBatchListener(final BatchListener<P> batchListener);  }
@Test public void testAfterBatchProcessing() { compositeBatchListener.afterBatchProcessing(batch); InOrder inOrder = inOrder(batchListener1, batchListener2); inOrder.verify(batchListener2).afterBatchProcessing(batch); inOrder.verify(batchListener1).afterBatchProcessing(batch); }