code: public static void distributeShare(
        double total, final Collection<? extends Schedulable> schedulables,
        ScheduleComparator comparator) {
      switch (comparator) {
      case FIFO:
      case DEADLINE:
        Schedulable.distributeShareSorted(total, schedulables, comparator);
        break;
      case FAIR:
        Schedulable.distributeShareFair(total, schedulables);
        break;
      case PRIORITY:
        Schedulable.distributeSharePriority(total, schedulables);
        break;
      default:
        throw new IllegalArgumentException("Unknown comparator");
      }
    }
docs: Distribute the shares among the schedulables based on the comparator
  @param total the total share to distribute
  @param schedulables the list of schedulables
  @param comparator the comparator to use when distributing the share