### Question:
Listeners { @WithTimer public void onProcessEvent(List<ProcessEvent> events) { ForkJoinTask<?> task = eventListenerPool.submit(() -> { eventListeners.parallelStream().forEach(l -> l.onEvents(events)); }); waitFor(task); } @Inject  Listeners(Collection<ProcessEventListener> eventListeners,
                     Collection<ProcessLogListener> logListeners,
                     Collection<AuditLogListener> auditLogListeners); @WithTimer void onProcessEvent(List<ProcessEvent> events); @WithTimer void onProcessLogAppend(ProcessLogEntry entry); @WithTimer void onAuditEvent(AuditEvent event);  }### Answer:
@Test public void test() { List<ProcessEvent> receivedEvents = new ArrayList<>(); Collection<ProcessEventListener> processEventListeners = Collections.singletonList(events -> { synchronized (receivedEvents) { receivedEvents.addAll(events); } }); Listeners listeners = new Listeners(processEventListeners, Collections.emptyList(), Collections.emptyList()); listeners.onProcessEvent(Collections.singletonList(ProcessEvent.builder() .processKey(new ProcessKey(UUID.randomUUID(), OffsetDateTime.now())) .eventSeq(0) .eventDate(OffsetDateTime.now()) .eventType("TEST") .data(Collections.singletonMap("x", 123)) .build())); assertEquals(1, receivedEvents.size()); }