def tasks_all_replaced_predicate(
        service_name,
        old_task_ids,
        task_predicate=None
):
    """ Returns whether ALL of old_task_ids have been replaced with new tasks

        :param service_name: the service name
        :type service_name: str
        :param old_task_ids: list of original task ids as returned by get_service_task_ids
        :type old_task_ids: [str]
        :param task_predicate: filter to use when searching for tasks
        :type task_predicate: func

        :return: True if none of old_task_ids are still present in the service
        :rtype: bool
    """
    try:
        task_ids = get_service_task_ids(service_name, task_predicate)
    except DCOSHTTPException:
        print('failed to get task ids for service {}'.format(service_name))
        task_ids = []

    print('waiting for all task ids in "{}" to change:\n- old tasks: {}\n- current tasks: {}'.format(
        service_name, old_task_ids, task_ids))
    for id in task_ids:
        if id in old_task_ids:
            return False  # old task still present
    if len(task_ids) < len(old_task_ids):  # new tasks haven't fully replaced old tasks
        return False
    return True