@Override
    public Optional<ScheduledExecution<Object>> getScheduledExecution(
        TaskInstanceId taskInstanceId) {
      Optional<Execution> e =
          taskRepository.getExecution(taskInstanceId.getTaskName(), taskInstanceId.getId());
      return e.map(oe -> new ScheduledExecution<>(Object.class, oe));
    }
Will cause getScheduledExecutions(..) to return executions in priority order.
db-scheduler/src/main/java/com/github/kagkarlsson/scheduler/SchedulerClient.java