Create a {@link Map} from flat array of objects.

@param keysAndValues
@return
512916
@SuppressWarnings("unchecked")
    public static <K extends Object, V extends Object> Map<K, V> createMap(
            Object... keysAndValues) {
        if (keysAndValues == null) {
            return null;
        }
        if (keysAndValues.length % 2 != 0) {
            throw new IllegalArgumentException("Number of arguments must be even!");
        }
        Map<K, V> result = new LinkedHashMap<>();
        for (int i = 0, n = keysAndValues.length / 2; i < n; i++) {
            result.put((K) keysAndValues[i * 2], (V) keysAndValues[i * 2 + 1]);
        }
        return result;
    }
53259
public static Map<String, List<Map<String, Object>>> nest(Map<String, Object> map, String... keys) {
        Map<String, List<Map<String, Object>>> result = new HashMap<String, List<Map<String, Object>>>(keys.length);
        String keyMatch = "";
        for (String key : keys) {
            result.put(key, new ArrayList<Map<String, Object>>());
            keyMatch = MessageFormat.format("{0}{1}|", keyMatch, Pattern.quote(key));
        }
        String patternString = MessageFormat.format("^({0})\\.([0-9]*)\\.(.*)", keyMatch.substring(0, keyMatch.length() - 1));
        Pattern pattern = Pattern.compile(patternString);
        for (Map.Entry<String, Object> entry : map.entrySet()) {
            String k = entry.getKey();
            Matcher matcher = pattern.matcher(k);
            if (matcher.matches()) {
                int base = 1;
                String key = matcher.group(1);
                processMatch(result.get(key), entry.getValue(), matcher, base);
            }
        }
        return result;
    }
761689
public static <K, V> ArrayList<V> valuesOfKeys(Map<K, V> map, Iterator<K> keys) {
		final ArrayList<V> values = new ArrayList<>();
		while (keys.hasNext()) {
			values.add(map.get(keys.next()));
		}
		return values;
	}
858156
public static boolean mapContainsKeys(Map<?, ?> _map, Object... _keys) {
        if (_map == null) {
            return false;
        } else if (_keys == null) {
            return true;
        }
        for (Object key : _keys) {
            if (key != null && !_map.containsKey(key)) {
                return false;
            }
        }
        return true;
    }
50655
public static final SerIterable map(final Class<?> keyType, final Class<?> valueType, final List<Class<?>> valueTypeTypes) {
        final Map<Object, Object> map = new HashMap<>();
        return map(keyType, valueType, valueTypeTypes, map);
    }
951236
public static <K, V> HashMap<K, V> newHashMap(@NotNull final K[] keys, @NotNull final V[] values) {
		Validate.isTrue(keys.length == values.length, "keys.length is %d but values.length is %d", keys.length,
				values.length);

		HashMap<K, V> map = new HashMap<K, V>(keys.length * 2);

		for (int i = 0; i < keys.length; i++) {
			map.put(keys[i], values[i]);
		}

		return map;
	}
997079
public static <KType, VType> KTypeVTypeHashMap<KType, VType> from(KType[] keys, VType[] values) {
    if (keys.length != values.length) {
      throw new IllegalArgumentException("Arrays of keys and values must have an identical length.");
    }

    KTypeVTypeHashMap<KType, VType> map = new KTypeVTypeHashMap<>(keys.length);
    for (int i = 0; i < keys.length; i++) {
      map.put(keys[i], values[i]);
    }

    return map;
  }
495866
public static <K, V> Map<K, V> newMap(
            Collection<Map.Entry<K, V>> collection) {
        return collection.stream()
                .collect(toMap(Map.Entry::getKey, Map.Entry::getValue));
    }
409419
public static <X,Y> Map<X,Y> zip(List<X> keys, List<Y> values) {
        if (keys.size() != values.size()) {
            throw new IllegalArgumentException("Lengths are not equal");
        }
        Map<X,Y> map = new HashMap<>(keys.size());
        for (int i=0; i<keys.size(); i++) {
            map.put(keys.get(i), values.get(i));
        }
        return map;
    }
1020541
function mapValues (object, map) {
  return Object.keys(object).reduce((clone, key) =>
    Object.assign(clone, { [key]: map(object[key], key) }), {})
}
191059
public static <K, V> Map<K, V> ofMap(Object... items) {
        HashMap<K, V> map = new LinkedHashMap<>(Math.max(1, items.length / 2));
        int len = items.length / 2;
        for (int i = 0; i < len; i++) {
            map.put((K) items[i * 2], (V) items[i * 2 + 1]);
        }
        return map;
    }
1137089
public static AnyValueMap fromMaps(Map<?, ?>... maps) {
		AnyValueMap result = new AnyValueMap();
		if (maps == null || maps.length == 0)
			return result;

		for (Map<?, ?> map : maps) {
			for (Map.Entry<?, ?> entry : map.entrySet()) {
				String key = StringConverter.toString(entry.getKey());
				Object value = entry.getValue();
				result.put(key, value);
			}
		}

		return result;
	}
316876
public static <T, K> HashMap<K, T> toHashMap(Collection<T> entities,
			Function<T, K> keyMapper) {
		return toMap(entities, keyMapper, HashMap<K, T>::new);
	}
639247
public static <K, V> HashMap<K, V> newHashMap(@NotNull final List<K> keys, @NotNull final List<V> values) {
		Validate.isTrue(keys.size() == values.size(), "keys.length is %s  but values.length is %s", keys.size(),
				values.size());

		HashMap<K, V> map = new HashMap<K, V>(keys.size() * 2);
		Iterator<K> keyIt = keys.iterator();
		Iterator<V> valueIt = values.iterator();

		while (keyIt.hasNext()) {
			map.put(keyIt.next(), valueIt.next());
		}

		return map;
	}
355653
public static <K, V> Set<K> keys(final Map<K, V> object) {
        return object.keySet();
    }
357661
public static Map<String, Object> newMap(String key, Object value) {
        final Map<String, Object> result = newMap();
        result.put(key, value);
        return result;
    }
213294
public static <A, B> Map<A, B> fromLists(List<A> keys, List<B> values) {
    Preconditions.checkArgument(keys.size() == values.size());
    Map<A, B> map = Maps.newHashMap();
    for (int i = 0; i < keys.size(); i++) {
      map.put(keys.get(i), values.get(i));
    }
    return map;
  }