code: public static <T> T get(Map map, String key, T def) {
          Object val = map.get(key);
          return val == null ? def : (T)val;
      }
docs: Retrieves a value from a map by key
  
  @param map Map to retrieve item from
  @param key the key whose associated value is to be returned
  @param def value to return if item was not found.
  @return Returns a string value that was found at the location key.
  If the item is null then the def value is sent back.
  If the item is not the expected type, an exception is thrown.
  @exception ClassCastException if the item found is not
  a the expected type.