code: private void applyResponseAcknowledgement(
              final Builder builder,
              final long rid) {
          assertLocked();
  
          if (responseAck.equals(Long.valueOf(-1L))) {
              // We have not received any responses yet
              return;
          }
  
          Long prevRID = Long.valueOf(rid - 1L);
          if (responseAck.equals(prevRID)) {
              // Implicit ack
              return;
          }
          
          builder.setAttribute(Attributes.ACK, responseAck.toString());
      }
docs: Sets the 'ack' attribute of the request to the value of the highest
  'rid' of a request for which it has already received a response in the
  case where it has also received all responses associated with lower
  'rid' values.  The only exception is that, after its session creation
  request, the client SHOULD NOT include an 'ack' attribute in any request
  if it has received responses to all its previous requests.
  
  @param builder message builder
  @param rid current request RID