Returns a list of values of the keys which exist in the specified <code>Map</code>.
If the key dosn't exist in the <code>Map</code>, No value will be added into the returned list.

@param map
@param keys
@return
498672
public static <K, V> List<V> getIfPresentForEach(final Map<K, V> map, final Collection<?> keys) {
        if (N.isNullOrEmpty(map) || N.isNullOrEmpty(keys)) {
            return new ArrayList<>(0);
        }

        final List<V> result = new ArrayList<>(keys.size());
        V val = null;

        for (Object key : keys) {
            val = map.get(key);

            if (val != null || map.containsKey(key)) {
                result.add(val);
            }
        }

        return result;
    }
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;
	}
752945
public static <T> Map<String, T> toLowerCaseKeys(Map<String, T> map) {
        Map<String, T> res = new HashMap<>();
        for (Map.Entry<String, T> entry : map.entrySet()) {
            res.put(entry.getKey().toLowerCase(), entry.getValue());
        }
        return res;
    }
1281449
@SuppressWarnings("unchecked")
	protected Map<String, Object> getNestedMap(Map<String, Object> map, String key) {
		Object value = map.get(key);
		if (value == null) {
			return Collections.emptyMap();
		}
		return (Map<String, Object>) value;
	}
889759
public static <K, E> List<E> getAndPutListIfAbsent(final Map<K, List<E>> map, final K key) {
        List<E> v = map.get(key);

        if (v == null) {
            v = new ArrayList<>();
            v = map.put(key, v);
        }

        return v;
    }
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;
    }
865755
public boolean containsKeys(Collection<K> keys) {
        for(K key: keys)
            if(!map.containsKey(key))
                return false;
        return true;
    }
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;
  }
1279921
@SuppressWarnings("unchecked")
  public static <K, V> MultiValueMap<K, V> unmodifiableMultiValueMap(
      final MultiValueMap<? extends K, ? extends V> map) {
    Assert.notNull(map, "'map' must not be null");
    final Map<K, List<V>> result = new LinkedHashMap<>(map.size());
    map.forEach((key, value) -> {
      final List<? extends V> values = Collections.unmodifiableList(value);
      result.put(key, (List<V>) values);
    });
    final Map<K, List<V>> unmodifiableMap = Collections.unmodifiableMap(result);
    return CollectionUtils.toMultiValueMap(unmodifiableMap);
  }
875124
public static <K, V> MutableList<Pair<K, V>> toListOfPairs(Map<K, V> map)
    {
        final MutableList<Pair<K, V>> pairs = FastList.newList(map.size());
        MapIterate.forEachKeyValue(map, new Procedure2<K, V>()
        {
            public void value(K key, V value)
            {
                pairs.add(Tuples.pair(key, value));
            }
        });
        return pairs;
    }
1102502
public static <K, V extends Comparable<V>> Map<K, V>
    sortByValue(Map<K, V> map) {
        return sort(map, comparing(map::get));
    }
819369
public static List<NameValuePair> toNameValuePair(Object parent, Map<String, String> map) {
		List<NameValuePair> list = new ArrayList<NameValuePair>();
		for (String key : map.keySet()) {
			NameValuePair nvp = new NameValuePair(parent, key, map.get(key));
			list.add(nvp);
		}
		return list;
	}
843203
public void binding(Map map)
	{
		Map<String, Object> values = map;
		if(values==null) return ;
		for (Entry<String,Object> entry : values.entrySet())
		{
			this.binding(entry.getKey(), entry.getValue());
		}
		
	}
22695
protected final Object mapLookup(Map map, Object key) {
        LOGGER.trace("get value from Map");
        return map.get(key);
    }
1182963
public String[] getKeysAsStrings(Map<String, ?> map) {
        String[] result = null;
        Set<String> keySet = map.keySet();
        int keySize = keySet.size();
        if (keySize > 0) {          
            result = keySet.toArray(new String[keySize]);
        }
        
        return result;
    }
454924
public void append(Map<?, ?> map) {
		if (map == null || map.size() == 0)
			return;

		for (Map.Entry<?, ?> entry : map.entrySet()) {
			put(StringConverter.toString(entry.getKey()), StringConverter.toNullableString(entry.getValue()));
		}
	}
442960
public static <K, V> Map<K, V> zip(Collection<K> keys, Collection<V> values) {
		if (isEmpty(keys) || isEmpty(values)) {
			return null;
		}

		final List<K> keyList = new ArrayList<K>(keys);
		final List<V> valueList = new ArrayList<V>(values);

		final int size = Math.min(keys.size(), values.size());
		final Map<K, V> map = new HashMap<K, V>((int) (size / 0.75));
		for (int i = 0; i < size; i++) {
			map.put(keyList.get(i), valueList.get(i));
		}

		return map;
	}