XMLQuery { public XMLQuery clone() { return new XMLQuery(this.nodes); } XMLQuery();  XMLQuery(List<Node> nodes);  XMLQuery(String xml); XMLQuery append(String xml); @Override String toString(); String toXML(); XMLQuery clone(); XMLQuery find(String query); String text(); int size(); XMLQuery item(int i); XMLQuery get(int i); String getContent(); String getContent(String parent); static XMLQuery create(List<Node> nodes); static XMLQuery parse(byte[] xml, boolean ns); void sort(Comparator<XMLQuery> comparator); static XMLQuery create(Node... list);  }
@Test public void testClone() { XMLQuery q = new XMLQuery(); q = q.append("<r><a><inner>1</inner><inner>2</inner></a><b v=\"v1\"/><c v=\"v2\">i</c></r>"); assertEquals("<r><a><inner>1</inner><inner>2</inner></a><b v=\"v1\"/><c v=\"v2\">i</c></r>", q.toXML()); XMLQuery q1 = q.clone(); XMLQuery q2 = q.clone(); assertEquals("<r><a><inner>1</inner><inner>2</inner></a><b v=\"v1\"/><c v=\"v2\">i</c></r>", q1.toXML()); assertEquals("<r><a><inner>1</inner><inner>2</inner></a><b v=\"v1\"/><c v=\"v2\">i</c></r>", q2.toXML()); assertFalse(q1.equals(q2)); assertEquals(2, q1.find(" }