public static ArrayList<State> findValidTargetState(State state, String name, boolean fuzzy) {
   ArrayList<State> result = new ArrayList<State>();
   for (State t : allValidTargetStates(state)) {
     if (t.getName().startsWith(name)) {
       if (fuzzy) result.add(t);
       else if (t.getName().equals(name)) result.add(t);
     }
   }
   return result;
 }
 public static ArrayList<Property> allProperties(State state) {
   ArrayList<Property> result = new ArrayList<Property>();
   // Properties from the states
   for (State s : allContainingStates(state)) {
     result.addAll(s.getProperties());
   }
   // Properties from the thing
   result.addAll(allProperties(findContainingThing(state)));
   return result;
 }
 public static ArrayList<State> allValidTargetStates(State state) {
   ArrayList<State> result = new ArrayList<State>();
   if (state instanceof CompositeState)
     result.addAll(findContainingRegion(state.eContainer()).getSubstate());
   else result.addAll(findContainingRegion(state).getSubstate());
   return result;
 }