@Test
public void readTextTest() throws XMLStreamException {

    String xml = "<a>hello</a>";
    try (StringReader reader = new StringReader(xml)) {
        XMLStreamReader xmlReader = XMLInputFactory.newInstance().createXMLStreamReader(reader);
        try {
            assertEquals("hello", XmlUtil.readText("a", xmlReader));
        } finally {
            xmlReader.close();
        }
    }
}