docs: AcquireResult drain(SemaphoreEndpoint endpoint, UUID invocationUid) {
          SessionSemaphoreState state = sessionStates.get(endpoint.sessionId());
          if (state != null) {
              Integer permits = state.getInvocationResponse(endpoint.threadId(), invocationUid);
              if (permits != null) {
                  return new AcquireResult(permits, Collections.<AcquireInvocationKey>emptyList());
              }
          }
  
          Collection<AcquireInvocationKey> cancelled = cancelWaitKeys(endpoint, invocationUid);
  
          int drained = available;
          if (drained > 0) {
              assignPermitsToInvocation(endpoint, invocationUid, drained);
          }
          available = 0;
  
          return new AcquireResult(drained, cancelled);
      }