from typing import Collection


def has_extension(path: str, extensions: Collection[str]) -> bool:
    """Check if a filename ends with one of given extensions.

    Examples:
    >>> has_extension('a.c', {'.c', '.cpp'})
    True
    >>> has_extension('a.c', {'.h'})
    False
    """
    for ext in extensions:
        if path.endswith(ext):
            return True
    return False