@Override
    public boolean matches(Job localJob, Job storageProviderJob) {
        if (storageProviderJob.getVersion() > localJob.getVersion() + 1) {
            Optional<ProcessingState> localProcessingState = localJob.getLastJobStateOfType(ProcessingState.class);
            Optional<ProcessingState> storageProviderProcessingState = storageProviderJob.getLastJobStateOfType(ProcessingState.class);
            if (localProcessingState.isPresent() && storageProviderProcessingState.isPresent()) {
                return !localProcessingState.get().getServerId().equals(storageProviderProcessingState.get().getServerId());
            }
        }
        return false;
    }
@Test
    void ifJobIsHavingConcurrentStateChangeOnSameServerItWillNotMatch() {
        final Job jobInProgress = aJobInProgress().build();
        final Job succeededJob = aCopyOf(jobInProgress).withState(new SucceededState(ofMillis(10), ofMillis(6))).build();

        boolean matchesAllowedStateChange = allowedStateChange.matches(jobInProgress, succeededJob);
        assertThat(matchesAllowedStateChange).isFalse();
    }