### Question:
XmlHandler { public static String getElementContent(String xml, String element) throws NoSuchFieldException { String result = ""; Pattern p = Pattern.compile("<" + element + ">(.*)</" + element + ">", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(xml); if (m.find()) result = m.group(1); else throw new NoSuchFieldException("Element '" + element + "' not found."); return result; }  static boolean isEvaluation(String xml); static boolean isWordEvaluation(String xml); static String getElementContent(String xml, String element); static String[] getLayoutEvaluations(String url); static String[] getWordEvaluations(String url);  }### Answer:
@Test public void testGetElementContent() throws NoSuchFieldException { String value = XmlHandler.getElementContent("\n<bla>123</bla>", "bla"); assertEquals("123", value); }
@Test(expected=NoSuchFieldException.class) public void testGetElementContentNoElement() throws NoSuchFieldException { XmlHandler.getElementContent("\n<bla>123</bla>", "bla2"); }