Find all matches in the `collection` for the specified `word`.

    If `word` is empty, returns all items in `collection`.

    :type word: str
    :param word: The substring to search for.

    :type collection: collection, usually a list
    :param collection: A collection of words to match.

    :rtype: list of strings
    :return: A sorted list of matching words from collection.

def substring_search(word, collection):
    """Find all matches in the `collection` for the specified `word`.

    If `word` is empty, returns all items in `collection`.

    :type word: str
    :param word: The substring to search for.

    :type collection: collection, usually a list
    :param collection: A collection of words to match.

    :rtype: list of strings
    :return: A sorted list of matching words from collection.
    """
    return [item for item in sorted(collection) if item.startswith(word)]