code: @Override
    public int compare(final Pair<ExecutionReference, ExecutableFlow> pair1,
        final Pair<ExecutionReference, ExecutableFlow> pair2) {
      ExecutableFlow exflow1 = null, exflow2 = null;
      if (pair1 != null && pair1.getSecond() != null) {
        exflow1 = pair1.getSecond();
      }
      if (pair2 != null && pair2.getSecond() != null) {
        exflow2 = pair2.getSecond();
      }
      if (exflow1 == null && exflow2 == null) {
        return 0;
      } else if (exflow1 == null) {
        return -1;
      } else if (exflow2 == null) {
        return 1;
      } else {
        // descending order of priority
        int diff = getPriority(exflow2) - getPriority(exflow1);
        if (diff == 0) {
          // ascending order of update time, if same priority
          diff = Long.compare(exflow1.getUpdateTime(), exflow2.getUpdateTime());
        }
        if (diff == 0) {
          // ascending order of execution id, if same priority and updateTime
          diff = exflow1.getExecutionId() - exflow2.getExecutionId();
        }
        return diff;
      }
    }
docs: <pre>
  Sorting order is determined by:-
  1. descending order of priority
  2. if same priority, ascending order of update time
  3. if same priority and updateTime, ascending order of execution id
  </pre>
  
  {@inheritDoc}
  
  @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)