code: public boolean addEvent(Hook k, Event n) {
          Set<Event> l = events.get(k);
          if (l == null) {
              l = new HashSet<>();
              events.put(k, l);
          }
          return l.add(n);
      }
docs: Add an event to the action.
  The moment the event will be executed depends on its hook.
  
  @param k the hook
  @param n the event to attach
  @return {@code true} iff the event was added