private static boolean tagCloses(final List<String> closeParts, final List<TagPart> openParts) {
    if (closeParts.size() > openParts.size()) {
      return false;
    }
    // The tag name is case-insensitive, but the tag values are not
    if (!closeParts.get(0).equalsIgnoreCase(openParts.get(0).value())) {
      return false;
    }
    for (int i = 1; i < closeParts.size(); i++) {
      if (!closeParts.get(i).equals(openParts.get(i).value())) {
        return false;
      }
    }
    return true;
  }
Determine if a set of close string parts closes the given list of open tag parts. If the open parts starts with
the set of close parts, then this method returns {@code true}.

@param closeParts The parts of the close tag
@param openParts The parts of the open tag
@return {@code true} if the given close parts closes the open tag parts.
text-minimessage/src/main/java/net/kyori/adventure/text/minimessage/internal/parser/TokenParser.java