DriftDefinitionCriteria criteria) {
PageList<DriftDefinition> defs = findDriftDefinitionsByCriteria(subject, criteria);
PageList<DriftDefinitionComposite> result = new PageList<DriftDefinitionComposite>(defs.getPageControl());
List<DriftDefinitionComposite> composites = new ArrayList<DriftDefinitionComposite>(defs.size());
GenericDriftChangeSetCriteria csCriteria = new GenericDriftChangeSetCriteria();
for (DriftDefinition def : defs) {
DriftDefinitionComposite composite = new DriftDefinitionComposite(def, null);
csCriteria.addFilterDriftDefinitionId(def.getId());
csCriteria.addSortVersion(PageOrdering.DESC);
csCriteria.setPageControl(PageControl.getSingleRowInstance());
PageList<? extends DriftChangeSet<?>> changeSets = findDriftChangeSetsByCriteria(subject, csCriteria);
if (!changeSets.isEmpty()) {
composite.setMostRecentChangeset(changeSets.get(0));
}
composites.add(composite);