code: public static <L, K> void addListener (Map<K, ListenerList<L>> map, K key, L listener)
      {
          ListenerList<L> list = map.get(key);
          if (list == null) {
              map.put(key, list = new ListenerList<L>());
          }
          list.add(listener);
      }
docs: Adds a listener to the listener list in the supplied map. If no list exists, one will be
  created and mapped to the supplied key.