Code example for AssertionFailedError

Methods: initCause

0
    static class Context { 
        private final InputSource inputSource;
        private final String url;
        private final String select;
 
        Context(InputSource inputSource, String url, String select) {
            this.inputSource = inputSource;
            this.url = url;
            this.select = select;
        } 
 
        Node getNode() {
            XPath xpath = XPathFactory.newInstance().newXPath();
            try { 
                return (Node) xpath.evaluate(select, inputSource, XPathConstants.NODE);
            } catch (XPathExpressionException e) {
                Error error = new AssertionFailedError("Failed to get context");
                error.initCause(e);
                throw error;
            } 
Connect your IDE to all the code out there  Get Codota for Java