class ProcessorEventPublisher {

    public void splitSegment(String context, List<String> clientIds, String processorName) {
        Map<ClientSegmentPair, SegmentStatus> clientToTracker =
                buildClientToTrackerMap(clientIds, processorName, REGULAR_ORDER);

        Integer biggestSegment = clientToTracker.values().stream()
                                                .min(Comparator.comparingInt(SegmentStatus::getOnePartOf))
                                                .map(SegmentStatus::getSegmentId)
                                                .orElseThrow(() -> new IllegalArgumentException(
                                                        "No segments found for processor name [" + processorName + "]"
                                                ));

        applicationEventPublisher.publishEvent(new SplitSegmentRequest(
                NOT_PROXIED,
                context,
                getClientIdForSegment(clientToTracker, biggestSegment)
                        .orElseThrow(() -> new IllegalArgumentException("No client found which has a claim on segment [" + biggestSegment + "]")),
                processorName,
                biggestSegment
        ));
    }

    public  ProcessorEventPublisher(PlatformService platformService,
                                   ApplicationEventPublisher applicationEventPublisher,
                                   ClientProcessors clientProcessors);

}