private static void removeEndingAsterisksFromTagIfNeeded(CompositeElement tag) {
    ASTNode current = tag.getLastChildNode();
    while (current != null && current.getElementType() == DOC_COMMENT_DATA) {
      if (current instanceof PsiDocToken) {
        return;
      }
      current = current.getTreePrev();
    }
    if (current != null && current.getElementType() == DOC_COMMENT_LEADING_ASTERISKS) {
      ASTNode prevWhiteSpace = TreeUtil.skipElementsBack(current.getTreePrev(), TokenSet.WHITE_SPACE);
      assert prevWhiteSpace != null;
      ASTNode toBeDeleted = prevWhiteSpace.getTreeNext();
      while (toBeDeleted != null) {
        ASTNode next = toBeDeleted.getTreeNext();
        tag.deleteChildInternal(toBeDeleted);
        toBeDeleted = next;
      }
    }
  }
private static void removeEndingAsterisksFromTagIfNeeded(CompositeElement tag)