@Override
    public Optional<Lock> lock(@Nonnull String resource, @Nullable String lockContext) {
        return doLock(resource, getLockedByString(lockContext));
    }
@Test
    void reentrantLock() {
        final Lock orig = lockService.lock("test-resource", null)
                .orElseThrow(() -> new IllegalStateException("Unable to create original lock."));

        final Optional<Lock> lock = lockService.lock("test-resource", null);

        assertThat(lock).hasValueSatisfying(l -> {
            assertThat(l.resource()).isEqualTo(orig.resource());
            assertThat(l.lockedBy()).isEqualTo(orig.lockedBy());
            assertThat(l.createdAt()).isEqualTo(orig.createdAt());
            assertThat(l.updatedAt()).isAfter(orig.updatedAt());
        });
    }