@Test
public void isNthSiblingTest() {

    Path el = div.that(hasTextContaining("x").and(isNthSibling(2)));
    String xpath = el.getXPath().get();
    NodeList nodes = findAllByXpath("<div class=\"a\">x</div><div class=\"b\">x</div><div class=\"c\">x</div><div class=\"d\">x</div>", el);
    assertThat(nodes.getLength(), is(1));
    assertThat(getCssClass(nodes.item(0)), is("c"));
    assertThat(el.toString(), is(equalTo("div, (has text containing \"x\" and is in place 2 among its siblings)")));
}