@Test
public void nullSafeGetStringAttribute() throws XPathExpressionException {

    Node node = (Node) XPathFactory.newInstance().newXPath().evaluate("/test", doc, XPathConstants.NODE);
    assertEquals("stringValue", XMLUtils.nullSafeGetStringAttribute(node, "stringAttr"));
    assertNull(XMLUtils.nullSafeGetStringAttribute(node, "chuckNorris"));
    Node node2 = (Node) XPathFactory.newInstance().newXPath().evaluate("/chuckNorris", doc, XPathConstants.NODE);
    assertNull(node2);
    assertNull(XMLUtils.nullSafeGetStringAttribute(node2, "kick"));
}