if (children.length == 0) { if (endOffset == -1) throw new NullPointerException("BranchElement has no children."); } else endOffset = children[children.length - 1].getEndOffset();  return endOffset;
Element child = numChildren > 0 ? children[numChildren - 1] : children[0]; return child.getEndOffset();
    public int getEndOffset()    {      if (children.length == 0)        {          if (endOffset == -1)            throw new NullPointerException("BranchElement has no children.");        }      else        endOffset = children[children.length - 1].getEndOffset();      return endOffset;    }