code: @Override
      public int compareTo(Tag tag) {
          int keyResult = this.key.compareTo(tag.key);
  
          if (keyResult != 0) {
              return keyResult;
          }
  
          return this.value.compareTo(tag.value);
      }
docs: Compares this tag to the specified tag.
  The tag comparison is based on a comparison of key and value in that order.
  
  @param tag The tag to compare to.
  @return 0 if equal, &lt; 0 if considered "smaller", and &gt; 0 if considered "bigger".