}
public void testLastFunction() {
Element root = new Element("html");
Element child1 = new Element("child1");
Element child2 = new Element("child2");
root.appendChild(child1);
root.appendChild(child2);
new Document(root);
Nodes result = child2.query("self::*[position()=last()]");
assertEquals(1, result.size());
assertEquals(child2, result.get(0));
}