@Override
    public ConcurrentJobModificationResolveResult resolve(Job localJob, Job storageProviderJob) {
        if (localJob.getState() == StateName.DELETED && storageProviderJob.getState() == StateName.DELETED) {
            throw shouldNotHappenException("Should not happen as matches filter should be filtering out this StateChangeFilter");
        } else if (localJob.getState() == StateName.PROCESSING && storageProviderJob.getState() == StateName.DELETED) {
            localJob.delete("Job is already deleted in StorageProvider");
            final Thread threadProcessingJob = jobSteward.getThreadProcessingJob(localJob);
            if (threadProcessingJob != null) {
                threadProcessingJob.interrupt();
            }
        }
        return ConcurrentJobModificationResolveResult.succeeded(localJob);
    }
@Test
    void ifJobDeletedWhileGoingToProcessingButThreadIsAlreadyRemoved() {
        final Job jobInProgress = aJobInProgress().build();
        final Job jobInProgressWithUpdate = aCopyOf(jobInProgress).withMetadata("extra", "metadata").build();
        final Job deletedJob = aCopyOf(jobInProgress).withDeletedState().build();

        final ConcurrentJobModificationResolveResult resolveResult = allowedStateChange.resolve(jobInProgressWithUpdate, deletedJob);
        assertThat(resolveResult.failed()).isFalse();
    }