//
Iterator it = artifactList.keySet().iterator();
// for each artifact type do reordering assertion
while (it.hasNext())
{
ProfileArtifact art = (ProfileArtifact) artifactList.get(it.next());
// result list of the reordering assertions
LinkedList res = new LinkedList();
Iterator it2 = art.getTestAssertionList().iterator();
// sort the artifact assertions into result list
while (it2.hasNext())
{
// call for each assertion ,
// if the assertion has the prereq, the prereq will added first into res list
sortTestAssertions(art, (TestAssertion) it2.next(), res);
}
// replace the original assertions list to the prereq reordering assertions list
art.getTestAssertionList().clear();
art.getTestAssertionList().addAll(res);
}
// Put the profile parts into the profile definition
profileAssertions.setArtifactList(artifactList);
return profileAssertions;