q.declareParameters("String referenceName");
Collection results = (Collection) q.execute(nameToFind);
assertTrue("Result is empty", !results.isEmpty());
Iterator it = results.iterator();
while (it.hasNext()) {
GeoRef g = (GeoRef) it.next();
assertTrue("Name of previous ref is not correct", nameToFind.equals(g.getPreviousRef().getName()));
}
q.closeAll();
pm.close();
}