### Question:
XmlUtil { public static int getIntAttribute(Node node, String attr, int def) { String value = getAttribute(node, attr); if (value == null) { return def; } try { return Integer.parseInt(value); } catch (NumberFormatException e) { 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 getIntAttribute() { assertEquals(INT_VALUE, XmlUtil.getIntAttribute(node, INT_ATTR)); assertEquals(INT_VALUE, XmlUtil.getIntAttribute(node, FAKE_ATTR, INT_VALUE)); assertEquals(INT_VALUE, XmlUtil.getIntAttribute(node, STRING_ATTR, INT_VALUE)); assertEquals("getIntAttribute must return 0 for undefined attributes.", 0, XmlUtil.getIntAttribute(node, FAKE_ATTR)); }