code: public boolean add(Tag tag) throws IllegalArgumentException {
          if(tag == null) {
              return false;
          }
  
          // If empty list, use this as tag type.
          if(this.type == null) {
              this.type = tag.getClass();
          } else if(tag.getClass() != this.type) {
              throw new IllegalArgumentException("Tag type cannot differ from ListTag type.");
          }
  
          return this.value.add(tag);
      }
docs: Adds a tag to this list tag.
  If the list does not yet have a type, it will be set to the type of the tag being added.
  
  @param tag Tag to add. Should not be null.
  @return If the list was changed as a result.
  @throws IllegalArgumentException If the tag's type differs from the list tag's type.