public static XPathType getPredicateType(XPathExpression expression) {
    // special: If the result is a number, the result will be converted to true if the number is equal to
    // the context position and will be converted to false otherwise;
    // (http://www.w3.org/TR/xpath#predicates)
    return expression.getType() == XPathType.NUMBER ? XPathType.NUMBER : XPathType.BOOLEAN;
  }
public static XPathType getPredicateType(XPathExpression expression)