CompositeJobListener implements JobListener { @Override public void beforeJob(JobParameters jobParameters) { for (JobListener listener : listeners) { listener.beforeJob(jobParameters); } } CompositeJobListener();  CompositeJobListener(List<JobListener> listeners); @Override void beforeJob(JobParameters jobParameters); @Override void afterJob(JobReport jobReport); void addJobListener(JobListener jobListener);  }
@Test public void testBeforeJobStart() { compositeJobListener.beforeJob(parameters); InOrder inOrder = inOrder(jobListener1, jobListener2); inOrder.verify(jobListener1).beforeJob(parameters); inOrder.verify(jobListener2).beforeJob(parameters); }