@Test
public void hasClassesTest() {

    Path el = div.that(hasClasses("not", "foo"));
    String xpath = el.getXPath().get();
    NodeList nodes = findAllByXpath("<div class=\"not-foo\"></div><div class=\" foo not\"></div><span class=\" foo \">abc</span>", el);
    assertThat(nodes.getLength(), is(1));
    assertThat(getCssClass(nodes.item(0)), equalTo(" foo not"));
    assertThat(getElementName(nodes.item(0)), equalTo("div"));
    assertThat(el.toString(), is(equalTo("div, that has classes [not, foo]")));
}