@SuppressWarnings("SameParameterValue")
    private static @NotNull Pair<Integer, Integer> findRangeOfParentTagWithGivenAttribute(
      @NotNull Element element,
      Object elementAttributeValue,
      @NotNull HTML.Tag tag,
      @NotNull HTML.Attribute attribute
    ) {
      HtmlIteratorWrapper anchorTagIterator = new HtmlIteratorWrapper(((HTMLDocument)element.getDocument()).getIterator(tag));
      return StreamSupport.stream(anchorTagIterator.spliterator(), false)
        .filter(it -> Objects.equals(it.getAttributes().getAttribute(attribute), elementAttributeValue))
        .filter(it -> it.getStartOffset() <= element.getStartOffset() && element.getStartOffset() <= it.getEndOffset())
        .map(it -> new Pair<>(it.getStartOffset(), it.getEndOffset()))
        .findFirst()
        .orElse(new Pair<>(element.getStartOffset(), element.getEndOffset()));
    }
@SuppressWarnings("SameParameterValue")
    private static @NotNull Pair<Integer, Integer> findRangeOfParentTagWithGivenAttribute(
      @NotNull Element element,
      Object elementAttributeValue,
      @NotNull HTML.Tag tag,
      @NotNull HTML.Attribute attribute
    )