### Question:
XpathUtils { public static Byte asByte(String expression, Node node) throws XPathExpressionException { String byteString = evaluateAsString(expression, node); return (isEmptyString(byteString)) ? null : Byte.valueOf(byteString); }  static Document documentFrom(InputStream is); static Document documentFrom(String xml); static Document documentFrom(URL url); static Double asDouble(String expression, Node node); static String asString(String expression, Node node); static Integer asInteger(String expression, Node node); static Boolean asBoolean(String expression, Node node); static Float asFloat(String expression, Node node); static Long asLong(String expression, Node node); static Byte asByte(String expression, Node node); static Date asDate(String expression, Node node); static ByteBuffer asByteBuffer(String expression, Node node); static boolean isEmpty(Node node); static int nodeLength(NodeList list); static Node asNode(String nodeName, Node node); static XPath xpath();  }### Answer:
@Test public void testAsByte() throws Exception { Document document = XpathUtils.documentFrom(DOCUMENT); assertEquals(new Byte((byte) 123), XpathUtils.asByte("Foo/PositiveByte", document)); assertEquals(new Byte((byte) -99), XpathUtils.asByte("Foo/NegativeByte", document)); assertNull(XpathUtils.asByte("Foo/Empty", document)); }
@Test public void testAsByte() throws Exception { Document document = XpathUtils.documentFrom(DOCUMENT); assertEquals(new Byte((byte) 123), XpathUtils.asByte("Foo/PositiveByte", document)); assertEquals(new Byte((byte) -99), XpathUtils.asByte("Foo/NegativeByte", document)); assertEquals(null, XpathUtils.asByte("Foo/Empty", document)); }