Лучше не итератором, а энумератором.
X++:
setEnumerator s;
Set unionKey;
Map map1, map2;
unionKey = set::union(map1.keySet(), map2.keySet());
s = unionKey.getEnumerator();
while (s.moveNext())
{
if (map1.exists(s.current()))
{
map1.lookup(s.current());
}
if (map2.exists(s.current()))
{
map2.lookup(s.current());
}
}