@Override
    public Optional<SimpleLock> lock(LockConfiguration lockConfiguration) {
        if (lockConfiguration.getLockAtMostFor().compareTo(minimalLockAtMostFor) < 0) {
            throw new IllegalArgumentException(
                    "Can not use KeepAliveLockProvider with lockAtMostFor shorter than " + minimalLockAtMostFor);
        }
        Optional<SimpleLock> lock = wrapped.lock(lockConfiguration);
        return lock.map(simpleLock -> new KeepAliveLock(lockConfiguration, simpleLock, executorService));
    }
@Test
    void shouldFailForShortLockAtMostFor() {
        assertThatThrownBy(() -> provider.lock(new LockConfiguration(now(), "short", ofMillis(100), ZERO)))
                .isInstanceOf(IllegalArgumentException.class);
    }