protected void saveAndRunJobFilters(List<Job> jobs) {
        if (jobs.isEmpty()) return;

        try {
            jobFilterUtils.runOnStateElectionFilter(jobs);
            storageProvider.save(jobs);
            jobFilterUtils.runOnStateAppliedFilters(jobs);
        } catch (ConcurrentJobModificationException concurrentJobModificationException) {
            try {
                backgroundJobServer.getConcurrentJobModificationResolver().resolve(concurrentJobModificationException);
            } catch (UnresolvableConcurrentJobModificationException unresolvableConcurrentJobModificationException) {
                throw new SevereJobRunrException("Could not resolve ConcurrentJobModificationException", unresolvableConcurrentJobModificationException);
            }
        }
    }
@Test
    void onConcurrentJobModificationExceptionTaskTriesToResolveAndThrowsNoExceptionIfResolved() {
        Job jobInProgress = aJobInProgress().build();
        Job deletedJob = aCopyOf(jobInProgress).withDeletedState().build();

        when(storageProvider.save(anyList())).thenThrow(new ConcurrentJobModificationException(jobInProgress));
        when(storageProvider.getJobById(jobInProgress.getId())).thenReturn(deletedJob);

        assertThatCode(() -> task.saveAndRunJobFilters(singletonList(jobInProgress))).doesNotThrowAnyException();
    }