@SafeVarargs // Iterating over an array is safe
    @SuppressWarnings("varargs")
    public static <K, V> Map<K, V> requireKeys(Map<K, V> map, K... requiredKeys) {
        requireNonNull(map);
        requireNonNullElements(requiredKeys);

        for (final K key : requiredKeys) {
            if (!map.containsKey(key)) {
                throw new NoSuchElementException("The Map does not contain the key " + key);
            }
        }

        return map;
    }
Checks if the provided map contains all the provided required non-null
key(s).

@param <K> key type
@param <V> value type
@param map to check
@param requiredKeys to check for existence
@return the same instance of the provided map
@throws NoSuchElementException if at least one required key is not a key
in the provided Map
@throws NullPointerException if the provided Map is null or if at least
one of the required key are null
common-parent/invariant/src/main/java/com/speedment/common/invariant/NullUtil.java