@Override
    public void resolve(ConcurrentJobModificationException e) {
        final List<Job> concurrentUpdatedJobs = e.getConcurrentUpdatedJobs();
        final List<ConcurrentJobModificationResolveResult> failedToResolve = concurrentUpdatedJobs
                .stream()
                .map(this::resolve)
                .filter(ConcurrentJobModificationResolveResult::failed)
                .collect(toList());

        if (!failedToResolve.isEmpty()) {
            throw new UnresolvableConcurrentJobModificationException(failedToResolve, e);
        }
    }
@Test
    void concurrentStateChangeForJobThatIsPerformedOnOtherBackgroundJobServerIsAllowed() {
        final Job jobInProgress = aJobInProgress().build();
        Job localJob = aCopyOf(jobInProgress).withVersion(3).build();
        Job storageProviderJob = aCopyOf(jobInProgress).withVersion(6).withFailedState().withScheduledState().withEnqueuedState(now()).withProcessingState().build();

        final Thread jobThread = mock(Thread.class);
        when(storageProvider.getJobById(localJob.getId())).thenReturn(storageProviderJob);
        lenient().when(jobSteward.getThreadProcessingJob(localJob)).thenReturn(jobThread);

        concurrentJobModificationResolver.resolve(new ConcurrentJobModificationException(localJob));

        verify(jobThread).interrupt();
    }