CompositeJobListener implements JobListener { @Override public void afterJob(JobReport jobReport) { for (ListIterator<JobListener> iterator = listeners.listIterator(listeners.size()); iterator.hasPrevious();) { iterator.previous().afterJob(jobReport); } } CompositeJobListener();  CompositeJobListener(List<JobListener> listeners); @Override void beforeJob(JobParameters jobParameters); @Override void afterJob(JobReport jobReport); void addJobListener(JobListener jobListener);  }
@Test public void testAfterJobEnd() { compositeJobListener.afterJob(report); InOrder inOrder = inOrder(jobListener1, jobListener2); inOrder.verify(jobListener2).afterJob(report); inOrder.verify(jobListener1).afterJob(report); }