static < K , E > List < E > getList ( Map < K , List < E > > map , K k ) { List < E > list = map . get ( k ) ; if ( list == null ) { list = new ArrayList < E > ( ) ; map . put ( k , list ) ; } return list ; }
Returns the list that is stored under the given key in the given map . If there is no list stored then a new list will be created inserted and returned