### Question:
XMLSource { public String getValue(String expression) { return getValue(expression, CastUtils.cast(Collections.emptyMap(), String.class, String.class)); } XMLSource(InputStream is); void setBuffering(); T getNode(String expression, Class<T> cls); @SuppressWarnings("unchecked") T getNode(String expression, Map<String, String> namespaces, Class<T> cls); T[] getNodes(String expression, Class<T> cls); @SuppressWarnings("unchecked") T[] getNodes(String expression, Map<String, String> namespaces, Class<T> cls); URI getLink(String expression); URI getLink(String expression, Map<String, String> namespaces); URI[] getLinks(String expression, Map<String, String> namespaces); URI getBaseURI(); String getValue(String expression); String getValue(String expression, Map<String, String> namespaces); String[] getValues(String expression); String[] getValues(String expression, Map<String, String> namespaces); @SuppressWarnings("unchecked") T getValue(String expression, Map<String, String> namespaces, Class<T> cls);  }### Answer:
@Test public void testGetStringValue() { InputStream is = new ByteArrayInputStream("<foo><bar/><bar id=\"2\"/></foo>".getBytes()); XMLSource xp = new XMLSource(is); String value = xp.getValue("/foo/bar/@id"); assertEquals("2", value); }