Map<String, Set<String>> map = new HashMap<String, Set<String>>();
while (iter.hasNext()) {
Object o = (Object) iter.next();
if (o instanceof Redundancy) {
Redundancy r = (Redundancy) o;
if (map.containsKey(r.getLeft().getRuleName())) {
Set<String> set = map.get(r.getLeft().getRuleName());
set.add(r.getRight().getRuleName());
} else {
Set<String> set = new HashSet<String>();
set.add(r.getRight().getRuleName());
map.put(r.getLeft().getRuleName(), set);
}
}
}
return map;