
class TaskSelector(object):
    def select(self, tasks):
        """
        :type tasks: list[parallels.core.task_manager.task.Task]
        :rtype: parallels.core.task_manager.task.Task | None
        """
        raise NotImplementedError()


class FirstTaskSelector(TaskSelector):
    def select(self, tasks):
        """
        :type tasks: list[parallels.core.task_manager.task.Task]
        :rtype: parallels.core.task_manager.task.Task | None
        """
        if len(tasks) > 0:
            return tasks[0]
        else:
            return None
