### Question:
XmlUtil { public static String getAttribute(Node node, String attr, String def) { NamedNodeMap attrs = node.getAttributes(); Node val = attrs.getNamedItem(attr); if (val != null) { return val.getNodeValue(); } return def; } private  XmlUtil(); static String getAttribute(Node node, String attr, String def); static String getAttribute(Node node, String attr); static Uri getUriAttribute(Node node, String attr, Uri def); static Uri getUriAttribute(Node node, String attr); static Uri getHttpUriAttribute(Node node, String attr, Uri base, Uri def); static Uri getHttpUriAttribute(Node node, String attr, Uri base); static boolean getBoolAttribute(Node node, String attr, boolean def); static boolean getBoolAttribute(Node node, String attr); static int getIntAttribute(Node node, String attr, int def); static int getIntAttribute(Node node, String attr); static Element parse(String xml); static Element parseSilent(String xml);  }### Answer:
@Test public void getAttribute() { assertEquals(STRING_VALUE, XmlUtil.getAttribute(node, STRING_ATTR)); assertEquals(STRING_VALUE, XmlUtil.getAttribute(node, FAKE_ATTR, STRING_VALUE)); assertNull("getAttribute must return null for undefined attributes.", XmlUtil.getAttribute(node, FAKE_ATTR)); }