code: private static TreeMap<Integer, Vector<Schedulable>>
        generatePriorityGroupedSchedulables(
          final Collection<? extends Schedulable> schedulables) {
      TreeMap<Integer, Vector<Schedulable>> prioritizedSchedulableMap =
          new TreeMap<Integer, Vector<Schedulable>>();
  
      for (Schedulable schedulable : schedulables) {
        if (! prioritizedSchedulableMap.containsKey(schedulable.getPriority())) {
          prioritizedSchedulableMap.put(schedulable.getPriority(),
                                        new Vector<Schedulable>());
        }
        prioritizedSchedulableMap.get(schedulable.getPriority()).add(schedulable);
      }
      return prioritizedSchedulableMap;
    }
docs: Group a collection of schedulables into priority groups
  sorted by priority.
  
  @param schedulables Collection of schedulables
  @return Sorted map of priority to vector of schedulables
  (lowest priority first)