class FIFOAgendaScheduler implements AgendaScheduler {

    @Override
    public List<ReadyAgenda> schedule(int requestCount, Insight insight, InsightScheduleInfo insightScheduleInfo)
    {
        DataObjectFeed<ReadyAgenda> readyAgendaFeed;
        try
        {
            readyAgendaFeed = readyAgendaPersister.retrieve(Arrays.asList(new ByInsightId(insight.getId())));
        }
        catch(PersistenceException e)
        {
            logger.error("Failed to retrieve ReadyAgendas for queue.", e);
            // todo: anything
            return null;
        }

        if(readyAgendaFeed.isError())
        {
            logger.error("ReadyAgenda feed returned with an error.", readyAgendaFeed.getException());
            return null;
        }

        List<ReadyAgenda> readyAgendas = readyAgendaFeed.getAll();
        List<ReadyAgenda> scheduledReadyAgendas = new ArrayList<>();
        if(readyAgendas.size() > 0)
        {
            scheduledReadyAgendas = readyAgendas.subList(0, Math.min(requestCount, readyAgendas.size()));
        }

        logger.info("FIFO Result -- InsightId: {} Scheduled: {} Requested: {}",
            insight.getId(), scheduledReadyAgendas.size(), requestCount);

        return scheduledReadyAgendas;
    }

    public  FIFOAgendaScheduler(ObjectPersister<ReadyAgenda> readyAgendaPersister);

}