HashMap<PrefixElement, ArrayList<ImportDirective>> prefixToDirectivesMap = new HashMap<PrefixElement, ArrayList<ImportDirective>>();
for (int i = 0; i < count; i++) {
Directive directive = directives.get(i);
if (directive instanceof ImportDirective) {
ImportDirective importDirective = (ImportDirective) directive;
SimpleIdentifier prefix = importDirective.getPrefix();
if (prefix != null) {
Element element = prefix.getStaticElement();
if (element instanceof PrefixElement) {
PrefixElement prefixElement = (PrefixElement) element;
ArrayList<ImportDirective> elements = prefixToDirectivesMap.get(prefixElement);
if (elements == null) {
elements = new ArrayList<ImportDirective>();