@Test
public void withTextContainingTest() {

    Path el = div.withTextContaining("AB");
    NodeList nodes = findAllByXpath("<div>ab</div><div>xabc</div><div class='container'><div class='a'><div class='a.a'></div></div><span class='b'/></div><div>c</div><div></div><span class='abc'></span>", el);
    assertThat(nodes.getLength(), is(2));
    assertThat(getText(nodes.item(0)), equalTo("ab"));
    assertThat(getText(nodes.item(1)), equalTo("xabc"));
    assertThat(el.toString(), is(equalTo("div, that has text containing \"AB\"")));
}