code: private void validateTrackerResponse(TrackerMessage message)
            throws AnnounceException {
      if (message instanceof ErrorMessage) {
        throw new AnnounceException(((ErrorMessage) message).getReason());
      }
  
      if (message instanceof UDPTrackerMessage &&
              (((UDPTrackerMessage) message).getTransactionId() != this.transactionId)) {
        throw new AnnounceException("Invalid transaction ID!");
      }
    }
docs: Validates an incoming tracker message.
  
  <p>
  Verifies that the message is not an error message (throws an exception
  with the error message if it is) and that the transaction ID matches the
  current one.
  </p>
  
  @param message The incoming tracker message.