@Override
    public boolean matches(Job localJob, Job storageProviderJob) {
        return AllowedConcurrentStateChange.super.matches(localJob, storageProviderJob)
                && localJob.getVersion() == storageProviderJob.getVersion() - 1
                && localJob.getLastJobStateOfType(FailedState.class).isPresent();
    }
@Test
    void ifLocalJobHasOtherThanEnqueuedStateItWillNotMatch() {
        final Job scheduledJob = aScheduledJob().build();
        final Job enqueuedJob = aCopyOf(scheduledJob).withEnqueuedState(Instant.now()).build();

        boolean matchesAllowedStateChange = allowedStateChange.matches(scheduledJob, enqueuedJob);
        assertThat(matchesAllowedStateChange).isFalse();
    }