final HashMap<SymbolAssignmentType, Collection<TreeElement>> groupedElements = new HashMap<SymbolAssignmentType, Collection<TreeElement>>(children.size());
for (TreeElement definition : children) {
if (definition instanceof AssignmentLeafViewTreeElement) {
final SymbolAssignmentType type = ((AssignmentLeafViewTreeElement) definition).getAssignmentType();
if (groupedElements.containsKey(type)) {
groupedElements.get(type).add(definition);
} else {
groupedElements.put(type, new HashSet<TreeElement>());
groupedElements.get(type).add(definition);