CompositePipelineListener implements PipelineListener { @Override public <P> Record<P> beforeRecordProcessing(Record<P> record) { Record<P> recordToProcess = record; for (PipelineListener listener : listeners) { recordToProcess = listener.beforeRecordProcessing(recordToProcess); } return recordToProcess; } CompositePipelineListener();  CompositePipelineListener(List<PipelineListener> listeners); @Override Record<P> beforeRecordProcessing(Record<P> record); @Override void afterRecordProcessing(Record<P> inputRecord, Record<P> outputRecord); @Override void onRecordProcessingException(Record<P> record, Throwable throwable); void addPipelineListener(PipelineListener pipelineListener);  }
@Test public void testBeforeRecordProcessing() { compositePipelineListener.beforeRecordProcessing(inputRecord); InOrder inOrder = inOrder(pipelineListener1, pipelineListener2); inOrder.verify(pipelineListener1).beforeRecordProcessing(inputRecord); inOrder.verify(pipelineListener2).beforeRecordProcessing(processedRecord); }