@Override
    public ConcurrentJobModificationResolveResult resolve(Job localJob, Job storageProviderJob) {
        final Thread threadProcessingJob = jobSteward.getThreadProcessingJob(localJob);
        if (threadProcessingJob != null) {
            threadProcessingJob.interrupt();
        }
        return ConcurrentJobModificationResolveResult.succeeded(storageProviderJob);
    }
@Test
    void ifJobIsHavingConcurrentStateChangeOnDifferentServerItWillResolveToTheStorageProviderJob() {
        //GIVEN
        final Job jobInProgress = aJobInProgress().build();
        final Job jobInProgressOnOtherServer = aCopyOf(jobInProgress)
                .withState(new FailedState("Orphaned job", new IllegalStateException("Not important")))
                .withState(new ScheduledState(Instant.now()))
                .withState(new EnqueuedState())
                .withState(new ProcessingState(UUID.randomUUID(), "Not important"))
                .build();

        // WHEN
        final ConcurrentJobModificationResolveResult resolveResult = allowedStateChange.resolve(jobInProgress, jobInProgressOnOtherServer);

        // THEN
        assertThat(resolveResult.failed()).isFalse();
        assertThat(resolveResult.getLocalJob()).isEqualTo(jobInProgressOnOtherServer);
        verify(threadProcessingLocalJob).interrupt();
    }