docs: ReleaseResult release(SemaphoreEndpoint endpoint, UUID invocationUid, int permits) {
          checkPositive(permits, "Permits should be positive!");
  
          long sessionId = endpoint.sessionId();
          if (sessionId != NO_SESSION_ID) {
              SessionSemaphoreState state = sessionStates.get(sessionId);
              if (state == null) {
                  return ReleaseResult.failed(cancelWaitKeys(endpoint, invocationUid));
              }
  
              if (state.containsInvocation(endpoint.threadId(), invocationUid)) {
                  return ReleaseResult.successful(Collections.<AcquireInvocationKey>emptyList(),
                          Collections.<AcquireInvocationKey>emptyList());
              }
  
              if (state.acquiredPermits < permits) {
                  return ReleaseResult.failed(cancelWaitKeys(endpoint, invocationUid));
              }
  
              state.acquiredPermits -= permits;
              state.invocationRefUids.put(endpoint.threadId(), Tuple2.of(invocationUid, permits));
          }
  
          available += permits;
  
          // order is important...
          Collection<AcquireInvocationKey> cancelled = cancelWaitKeys(endpoint, invocationUid);
          Collection<AcquireInvocationKey> acquired = assignPermitsToWaitKeys();
  
          return ReleaseResult.successful(acquired, cancelled);
      }