code: private static double assignShareIfUnderAllocated(
        double totalShare,
        final Collection<? extends Schedulable> schedulables) {
  
      double totalMinDemand = 0;
      for (Schedulable schedulable : schedulables) {
        schedulable.share = 0;
        totalMinDemand += Math.min(schedulable.getRequested(),
                                   schedulable.getMinimum());
      }
  
      if ((totalMinDemand > 0) && (totalMinDemand >= totalShare)) {
        distributeShareMin(schedulables);
      }
  
      return totalShare - totalMinDemand;
    }
docs: Assign fair share if total share < min demand.
  
  @param totalShare   The share to be distributed.
  @param schedulables The collection of schedulables
  @return Excess share after assigning the min demand to each schedulable.