### Question:
XmlUtil { public static Element parse(String xml) throws XmlException { DocumentBuilder builder = null; try { builder = getBuilder(); InputSource is = new InputSource(new StringReader(xml.trim())); return builder.parse(is).getDocumentElement(); } catch (SAXParseException e) { throw new XmlException( e.getMessage() + " At: (" + e.getLineNumber() + ',' + e.getColumnNumber() + ')', e); } catch (SAXException e) { throw new XmlException(e); } catch (ParserConfigurationException e) { throw new XmlException(e); } catch (IOException e) { throw new XmlException(e); } finally { if (builder != null) { builder.setErrorHandler(null); } } } 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(expected=XmlException.class) public void parseBadXmlThrows() throws XmlException { XmlUtil.parse("malformed xml"); }