private static void mapAdd(Map<String, List<String>> map, String key, String val) {
    List<String> list = map.get(key);
    if (list == null) {
      list = new ArrayList<>();
      map.put(key, list);
    }
    list.add(val);
  }
private static void mapAdd ( Map < String , List < String > > map , String key , String val ) { List < String > list = map . get ( key ) ; if ( list == null ) { list = new ArrayList < > ( ) ; map . put ( key , list ) ; } list . add ( val ) ; }
Adds a key and value to a Map<String, List<String>>.