@Test
public void hasAggrgatedTextTest() {

    Path el = div.that(hasAggregatedTextEqualTo("ABCD"));
    String xpath = el.getXPath().get();
    NodeList nodes = findAllByXpath("<div>aBcd</div><div><span>ab</span><div>cd</div></div><span>abc</span>", el);
    assertThat(nodes.getLength(), is(2));
    assertThat(getText(nodes.item(0)), equalTo("aBcd"));
    assertThat(getText(nodes.item(1).getFirstChild()), equalTo("ab"));
    assertThat(el.toString(), is(equalTo("div, with aggregated text \"ABCD\"")));
}