@Test
public void divThatBeforeSpan() {

    Path el = div.that(isBefore(span));
    String xpath = el.getXPath().get();
    NodeList nodes = findAllByXpath("<div>foo</div><div>boo</div><span></span>", el);
    assertThat(nodes.getLength(), is(2));
    assertThat(getText(nodes.item(0)), equalTo("foo"));
    assertThat(getText(nodes.item(1)), equalTo("boo"));
    assertThat(el.toString(), is(equalTo("div, that is before: span")));
}