public static ArrayList<Message> allOutgoingMessages(Thing thing) {
   ArrayList<Message> result = new ArrayList<Message>();
   for (Port p : allPorts(thing)) {
     for (Message m : p.getSends()) {
       if (!result.contains(m)) result.add(m);
     }
   }
   return result;
 }
 public static ArrayList<Port> findPort(Thing thing, String name, boolean fuzzy) {
   ArrayList<Port> result = new ArrayList<Port>();
   for (Port t : allPorts(thing)) {
     if (t.getName().startsWith(name)) {
       if (fuzzy) result.add(t);
       else if (t.getName().equals(name)) result.add(t);
     }
   }
   return result;
 }
 public static ArrayList<Message> findOutgoingMessage(Port port, String name, boolean fuzzy) {
   ArrayList<Message> result = new ArrayList<Message>();
   for (Message t : port.getSends()) {
     if (t.getName().startsWith(name)) {
       if (fuzzy) result.add(t);
       else if (t.getName().equals(name)) result.add(t);
     }
   }
   return result;
 }