docs: AcquireResult acquire(LockInvocationKey key, boolean wait) {
          LockEndpoint endpoint = key.endpoint();
          UUID invocationUid = key.invocationUid();
          RaftLockOwnershipState memorized = ownerInvocationRefUids.get(Tuple2.of(endpoint, invocationUid));
          if (memorized != null) {
              AcquireStatus status = memorized.isLocked() ? SUCCESSFUL : FAILED;
              return new AcquireResult(status, memorized.getFence(), Collections.<LockInvocationKey>emptyList());
          }
  
          if (owner == null) {
              owner = key;
          }
  
          if (endpoint.equals(owner.endpoint())) {
              if (lockCount == lockCountLimit) {
                  ownerInvocationRefUids.put(Tuple2.of(endpoint, invocationUid), NOT_LOCKED);
                  return AcquireResult.failed(Collections.<LockInvocationKey>emptyList());
              }
  
              lockCount++;
              ownerInvocationRefUids.put(Tuple2.of(endpoint, invocationUid), lockOwnershipState());
              return AcquireResult.acquired(owner.commitIndex());
          }
  
          // we must cancel waits keys of previous invocation of the endpoint
          // before adding a new wait key or even if we will not wait
          Collection<LockInvocationKey> cancelledWaitKeys = cancelWaitKeys(endpoint, invocationUid);
  
          if (wait) {
              addWaitKey(endpoint, key);
              return AcquireResult.waitKeyAdded(cancelledWaitKeys);
          }
  
          return AcquireResult.failed(cancelledWaitKeys);
      }