public static State getParentState(StateGraphNode s) { if (isTopLevel(s)) return null; else return (State) s.eContainer().eContainer(); }
public static boolean isTopLevel(StateGraphNode s) { return !(s.eContainer().eContainer() instanceof State); }