}
        NodeProxy hasDescendantsInSet(NodeId ancestorId, int contextId, boolean includeSelf) {            // do a binary search to pick some node in the range of valid child            // ids            int low = 0;            int high = length - 1;            int mid = 0;            int cmp;            NodeId id;            while (low <= high) {                mid = (low + high) / 2;                id = array[mid].getNodeId();                if (id.isDescendantOrSelfOf(ancestorId))                    break;	// found a child node, break out.                cmp = id.compareTo(ancestorId);                if (cmp > 0)                    high = mid - 1;                else                    low = mid + 1;            }            if (low > high)                return null; // no node found            // find the first child node in the range            while (mid > 0 && array[mid - 1].getNodeId().compareTo(ancestorId) >= 0)                --mid;            NodeProxy ancestor = new NodeProxy(getDocument(), ancestorId, Node.ELEMENT_NODE);            for (int i = mid; i < length; i++) {                boolean add = (includeSelf ? array[i].getNodeId().isDescendantOrSelfOf(ancestorId) :                        array[i].getNodeId().isDescendantOf(ancestorId));                if (add) {                    if (Expression.NO_CONTEXT_ID != contextId)                        ancestor.deepCopyContext(array[i], contextId);                    else                        ancestor.copyContext(array[i]);//                        ancestor.addMatches(array[i]);                } else                    break;            }            return ancestor;        }