ArrayList<String> definitionQnames = new ArrayList<String>(cu.getDefinitionPromises().size());
for (IDefinition definition : cu.getDefinitionPromises())
definitionQnames.add(definition.getQualifiedName());
Collections.sort(definitionQnames, new QNameComparator());
for (String qname : definitionQnames)
{
int lastOccurence = qname.lastIndexOf('.');