@Override
 public Iterable<TimelineRecord> getNextRecords(int maxResults) {
   SortedSet<TimelineRecord> result = new TreeSet<>();
   UnitOfWork uow = module.currentUnitOfWork();
   String schedulesName = SchedulerMixin.getSchedulesIdentity(scheduler);
   Schedules schedules = uow.get(Schedules.class, schedulesName);
   for (Schedule schedule : schedules.schedules()) {
     Timeline timeline = (Timeline) schedule;
     Iterable<TimelineRecord> lastRecords = timeline.getNextRecords(maxResults);
     Iterables.addAll(result, lastRecords);
   }
   return Iterables.limit(maxResults, result);
 }
  @Override
  public Iterable<TimelineRecord> getRecords(DateTime from, DateTime to) {
    SortedSet<TimelineRecord> result = new TreeSet<>();

    UnitOfWork uow = module.currentUnitOfWork();
    String schedulesName = SchedulerMixin.getSchedulesIdentity(scheduler);
    Schedules schedules = uow.get(Schedules.class, schedulesName);
    for (Schedule schedule : schedules.schedules()) {
      Timeline timeline = (Timeline) schedule;
      Iterable<TimelineRecord> lastRecords = timeline.getRecords(from, to);
      Iterables.addAll(result, lastRecords);
    }
    return result;
  }