@Test
public void hasTextEndingWithTest() {

    Path el = div.that(hasTextEndingWith("abc"));
    String xpath = el.getXPath().get();
    NodeList nodes = findAllByXpath("<div>abcd</div><div>xxABC</div><span>abc </span>", el);
    assertThat(nodes.getLength(), is(1));
    assertThat(getText(nodes.item(0)), equalTo("xxABC"));
    assertThat(getElementName(nodes.item(0)), equalTo("div"));
    assertThat(el.toString(), is(equalTo("div, that has text that ends with \"abc\"")));
}