code: public static boolean checkOpenTagClosesOptional(TagName openTag, TagName optionalOpenTag) {
      checkArgument(optionalOpenTag.isDefinitelyOptional(), "Open tag is not optional.");
      if (!(openTag.isStatic() && optionalOpenTag.isStatic())) {
        return false;
      }
      String optionalTagName = optionalOpenTag.getStaticTagNameAsLowerCase();
      String openTagName = openTag.getStaticTagNameAsLowerCase();
      return OPTIONAL_TAG_OPEN_CLOSE_RULES.containsEntry(optionalTagName, openTagName);
    }
docs: Checks if the given open tag can implicitly close the given optional tag.
  
  <p>This implements the content model described in
  https://www.w3.org/TR/html5/syntax.html#optional-tags.
  
  <p><b>Note:</b>If {@code this} is a dynamic tag, then this test alsways returns {@code false}
  because the tag name can't be determined at parse time.
  
  <p>Detects two types of implicit closing scenarios:
  
  <ol>
  <li>an open tag can implicitly close another open tag, for example: {@code <li> <li>}
  <li>a close tag can implicitly close an open tag, for example: {@code <li> </ul>}
  </ol>
  
  @param openTag the open tag name to check. Must be an {@link HtmlOpenTagNode}.
  @param optionalOpenTag the optional tag that may be closed by this tag. This must be an
  optional open tag.
  @return whether {@code htmlTagName} can close {@code optionalTagName}