public CharSequence getText(int i, CharSequence text) {
        if (children(i).isEmpty()) {
            return null;
        }
        StringBuilder str = new StringBuilder();
        List<SpanNode> ch = children(i);
        for (SpanNode node : ch) {
            CharSequence childText = node.getText(text);
            if (childText != null) {
                str.append(node.getText(text));
            }
        }
        return str;
    }
Returns the text covered by this span as given by subtree i, or null if subtree i is empty.

@param i    the index of the subtree to use
@param text the text to get a substring from
@return the text covered by this span as given by subtree i, or null if subtree i is empty
document/src/main/java/com/yahoo/document/annotation/AlternateSpanList.java