docs: protected void mergeGlobalOptions(final ContentSpecWrapper contentSpecEntity, final ContentSpec contentSpec,
              final TagProvider tagProvider) {
          // make sure the condition matches
          contentSpecEntity.setCondition(contentSpec.getBaseLevel().getConditionStatement());
  
          // Merge the global tags
          final List<String> tags = contentSpec.getTags();
          final CollectionWrapper<TagWrapper> tagsCollection = contentSpecEntity.getBookTags() == null ? tagProvider.newTagCollection() :
                  contentSpecEntity.getBookTags();
  
          // Check to make sure we have something to process
          if (!(tags.isEmpty() && tagsCollection.isEmpty())) {
              final List<TagWrapper> existingTags = new ArrayList<TagWrapper>(tagsCollection.getItems());
  
              // Add any new book tags
              for (final String tagName : tags) {
                  final TagWrapper existingTag = findExistingBookTag(tagName, existingTags);
                  if (existingTag == null) {
                      LOG.debug("Adding global book tag {}", tagName);
                      final TagWrapper tag = tagProvider.getTagByName(tagName);
                      tagsCollection.addNewItem(tag);
                  } else {
                      existingTags.remove(existingTag);
                  }
              }
  
              // Remove any existing book tags that are no longer valid
              if (!existingTags.isEmpty()) {
                  for (final TagWrapper existingTag : existingTags) {
                      LOG.debug("Removing global book tag {}", existingTag.getName());
                      tagsCollection.remove(existingTag);
                      tagsCollection.addRemoveItem(existingTag);
                  }
              }
  
              contentSpecEntity.setBookTags(tagsCollection);
          }
      }