newGroup.add(resource);
}
// Keep the original group
map.put(group.getName(), new LinkedHashSet<Resource>(resources));
}
WroModel output = new WroModel();
for (Entry<String, Set<Resource>> g : map.entrySet()) {
Group newGroup = new Group(g.getKey());
Set<Resource> resources = g.getValue();
for (Resource resource : resources) {
newGroup.addResource(resource);
}
output.addGroup(newGroup);
}
return output;
}