code: static <K, E> void removeFromList(Map<K, List<E>> map, K k, E e)
      {
          List<E> list = map.get(k);
          if (list != null)
          {
              list.remove(e);
              if (list.isEmpty())
              {
                  map.remove(k);
              }
          }
      }
docs: Removes the given element from the list that is stored under the
  given key. If the list becomes empty, it is removed from the
  map.
  
  
  @param <K> The key type
  @param <E> The element type
  @param map The map
  @param k The key
  @param e The element