head = mk.commit("/", "+ \"children\": { \"c1\": {\"p\": \"1\"}, \"c2\": {\"p\": \"1\"}, \"c3\": {\"p\": \"2\"}, \"c4\": {\"p\": \"3\"}}", head, "");
FilterImpl f = new FilterImpl(null);
f.setPath("/");
List<String> paths = new ArrayList<String>();
Cursor c = t.query(f, head);
while (c.next()) {
paths.add(c.currentPath());
}
Collections.sort(paths);
assertEquals(Arrays.asList(
"/", "/children", "/children/c1", "/children/c2",
"/children/c3", "/children/c4", "/parents",
"/parents/p0", "/parents/p1", "/parents/p2"),
paths);
assertFalse(c.next());
// endure it stays false
assertFalse(c.next());
f.setPath("/nowhere");
c = t.query(f, head);
assertFalse(c.next());
// endure it stays false
assertFalse(c.next());
}