code: static <K, V> Map<V, K> invert(Map<K, V> map)
      {
          Map<V, K> result = new LinkedHashMap<V, K>();
          for (Entry<K, V> entry : map.entrySet())
          {
              result.put(entry.getValue(), entry.getKey());
          }
          return result;
      }
docs: Returns the inverse of the given map. If multiple keys are mapped
  to the same value in the given input map, then the value will be
  mapped to the last key (in iteration order) for which it is found.
  
  @param <K> The key type
  @param <V> The value type
  @param map The map
  @return The inverse map