class WorkerRegistryV2 implements WorkerRegistry, WorkerEventSubscriber {

    @Override
    public Map<WorkerId, String> getAllRunningWorkerSlaveIdMappings() {
        return jobToWorkerInfoMap.values().stream()
                .flatMap(workerList -> workerList.stream()
                .filter(wm -> WorkerState.isRunningState(wm.getState())))
                .collect(toMap(
                        IMantisWorkerMetadata::getWorkerId,
                        IMantisWorkerMetadata::getSlaveID,
                        (s1, s2) -> (s1 != null) ? s1 : s2));
    }

      WorkerRegistryV2();

}