TransitionTarget lca = SCXMLHelper.getLCA((TransitionTarget)
tts.get(0), (TransitionTarget) tts.get(1));
if (lca == null || !(lca instanceof Parallel)) {
return false; // Must have a Parallel LCA
}
Parallel p = (Parallel) lca;
Set regions = new HashSet();
for (int i = 0; i < tts.size(); i++) {
TransitionTarget tt = (TransitionTarget) tts.get(i);
while (tt.getParent() != p) {
tt = tt.getParent();
}
if (!regions.add(tt)) {
return false; // One per region
}
}
if (regions.size() != p.getChildren().size()) {
return false; // Must represent all regions
}
return true;
}