private static boolean isAtTheEndOfEmptyTag(Project project, Editor editor, PsiFile file, HighlighterIterator iterator) {
    if (iterator.getTokenType() != XmlTokenType.XML_TAG_END) {
      return false;
    }

    PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
    final PsiElement element = file.findElementAt(iterator.getStart());

    if (element == null) {
      return false;
    }

    final PsiElement parent = element.getParent();
    return parent instanceof XmlTag &&
           parent.getTextRange().getEndOffset() == iterator.getEnd();
  }
private static boolean isAtTheEndOfEmptyTag(Project project, Editor editor, PsiFile file, HighlighterIterator iterator)