### Question:
XPath { public static String decode(final CharSequence text) { if ( text == null ) { throw new NullPointerException("null text"); } final StringBuffer buffer=new StringBuffer(text.length()); final Matcher matcher=EntityPattern.matcher(text); while ( matcher.find() ) { matcher.appendReplacement(buffer, ""); buffer.append(Character.toChars( Integer.parseInt(matcher.group("code"), matcher.group("hex").isEmpty() ? 10 : 16) )); } matcher.appendTail(buffer); return buffer.toString(); } XPath(final Node node); static Function<Node, R> XPath(final Function<XPath, R> query); static String decode(final CharSequence text); Node node(); Document document(); Optional<Boolean> bool(final String xpath); Optional<Double> number(final String xpath); Optional<String> string(final String xpath); Stream<String> strings(final String xpath); Optional<String> link(final String xpath); Stream<String> links(final String xpath); Optional<Element> element(final String xpath); Stream<Element> elements(final String xpath); Optional<Node> node(final String xpath); Stream<Node> nodes(final String xpath); static final String DefaultPrefix; }### Answer:
@Test void decodeNumericEntities() { assertThat(decode("Italy&#x2019;s &#8220;most powerful&#8221; car")) .isEqualTo("Italy’s “most powerful” car"); }