code: public static <K, V> void putList(Map<K, List<V>> map, K key, V valueElt) {
          if (map.containsKey(key)) {
              List<V> l = map.get(key);
              l.add(valueElt);
          } else {
              List<V> l = new ArrayList<>();
              l.add(valueElt);
              map.put(key, l);
          }
      }
docs: Puts a value into a map of key -> list of values. If the specified key
  is new, it creates an {@link ArrayList} as its value.
  @param map a {@link Map}.
  @param key a key.
  @param valueElt a value.