Creates a new AnyValueMap by merging two or more maps. Maps defined later in
the list override values from previously defined maps.

@param maps an array of maps to be merged
@return a newly created AnyValueMap.
507252
public static StringValueMap fromMaps(Map<?, ?>... maps) {
		StringValueMap result = new StringValueMap();
		if (maps != null && maps.length > 0) {
			for (Map<?, ?> map : maps)
				result.append(map);
		}
		return result;
	}
1234357
public TemplateTypeMap createTemplateTypeMap(
      ImmutableList<TemplateType> templateKeys,
      ImmutableList<JSType> templateValues) {
    if (templateKeys == null) {
      templateKeys = ImmutableList.of();
    }
    if (templateValues == null) {
      templateValues = ImmutableList.of();
    }
    return (templateKeys.isEmpty() && templateValues.isEmpty())
        ? emptyTemplateTypeMap
            : new TemplateTypeMap(this, templateKeys, templateValues);
  }
845380
public static Mapper mapMapper(final Map map) {
        return new Mapper() {
            public Object map(final Object a) {
                return map.get(a);
            }
        };
    }
1143909
public ValueMap getValueMap(Object key) {
    Object value = get(key);
    if (value instanceof ValueMap) {
      return (ValueMap) value;
    } else if (value instanceof Map) {
      //noinspection unchecked
      return new ValueMap((Map<String, Object>) value);
    } else {
      return null;
    }
  }
1059660
public static <K, V> KeyValueSink<K, V> asMapSink(ImmutableMultimap.Builder<K, V> multimapB) {
    return new ImmutableMultimapBuilderSink<>(multimapB);
  }
1051996
public static Expression newLinkedHashMap(
      Iterable<? extends Expression> keys, Iterable<? extends Expression> values) {
    return newMap(keys, values, ConstructorRef.LINKED_HASH_MAP_CAPACITY, LINKED_HASH_MAP_TYPE);
  }
326209
public static MultiValueMap asMultiValueMap(final Map innerMap) {
        return org.springframework.util.CollectionUtils.toMultiValueMap(innerMap);
    }
165453
public static <K, V> void putAllIntoListMap(K key, Collection<? extends V> values, Map<? super K, List<V>> map) {
		List<V> list = map.get(key);
		if (list == null) {
			list = Lists.newArrayList(values);
			map.put(key, list);
		} else {
			list.addAll(values);
		}
	}
1065404
private static int mergeMaps(Map<String, Integer> map, Map<String, Integer> other)
    {
        int deltaSize = 0;
        for (Map.Entry<String, Integer> entry : other.entrySet()) {
            if (!map.containsKey(entry.getKey())) {
                deltaSize += entry.getKey().getBytes().length + SIZE_OF_INT;
            }
            map.put(entry.getKey(), map.getOrDefault(entry.getKey(), 0) + other.getOrDefault(entry.getKey(), 0));
        }
        return deltaSize;
    }
1060636
public static Map<String, String> create(String... nameValuePairs) {
        Map<String, String> map = new HashMap<>();

        if (nameValuePairs != null) {
            for (String nameValuePair : nameValuePairs) {
                String[] tokens = nameValuePair.split("=");
                if (tokens.length == 2) {
                    map.put(tokens[0], tokens[1]);
                }
            }
        }

        return map;
    }
668331
public static <K,V> MultiValueMap<K,V> unmodifiableMultiValueMap(MultiValueMap<? extends K, ? extends V> map) {
		Assert.notNull(map, "'map' must not be null");
		Map<K, List<V>> result = new LinkedHashMap<K, List<V>>(map.size());
		for (Map.Entry<? extends K, ? extends List<? extends V>> entry : map.entrySet()) {
			List<V> values = Collections.unmodifiableList(entry.getValue());
			result.put(entry.getKey(), values);
		}
		Map<K, List<V>> unmodifiableMap = Collections.unmodifiableMap(result);
		return toMultiValueMap(unmodifiableMap);
	}
288410
public static <K, V> Map<K, V> newCombinedMap(K[] keys,
            V[] values) {
        HashMap<K, V> map = new HashMap<>();
        for (int i = 0; i < keys.length; i++)
            map.put(keys[i], getValueOfIndex(values, i));
        return map;
    }
764053
public MultiMap merge(MultiMap multiMap)
    {
        MultiMap result = new MultiMap();
        result.map.putAll(this.map);
        result.map.putAll(multiMap.map);
        return result;
    }
777117
def from_maps(*maps):
        
        result = AnyValueMap()
        
        if maps == None or len(maps) == 0:
            return result

        for map in maps:
            for (key, value) in map.items():
                key = StringConverter.to_string(key)
                result.put(key, value)

        return result
993011
public static <K, V> StreamableHashMap<K, V> newMap (Map<? extends K, ? extends V> map)
    {
        return new StreamableHashMap<K, V>(map);
    }
1366952
public static Map mapKeys(Mapper mapper, Map map, boolean allowNull) {
        HashMap h = new HashMap();
        for (Object e : map.entrySet()) {
            Map.Entry entry = (Map.Entry) e;
            Object o = mapper.map(entry.getKey());
            if (allowNull || o != null) {
                h.put(o, entry.getValue());
            }
        }
        return h;
    }
441212
@SuppressWarnings("unchecked")
	public static <K, V> Map<K, V> createMap(Class<?> mapType) {
		if (mapType.isAssignableFrom(AbstractMap.class)) {
			return new HashMap<>();
		} else {
			return (Map<K, V>) ReflectUtil.newInstance(mapType);
		}
	}