code: public static <K, V> Function<K, V> fromMap(
          final Map<? super K, ? extends V> map, final V defaultValue)
      {
          return new Function<K, V>()
          {
              @Override
              public V apply(K k)
              {
                  V result = map.get(k);
                  if (result == null)
                  {
                      if (!map.containsKey(k))
                      {
                          return defaultValue;
                      }
                  }
                  return result;
              }
          };
      }
docs: Create a {@link Function} that is backed by the given map.
  Modifications of the given map will be visible through
  the returned function.
  
  @param <K> The key type
  @param <V> The value type
  @param map The backing map
  @param defaultValue The default value to return when a
  function argument is not contained in the map.
  @return The new function