code: private static double shareWithRatio(
        Schedulable schedulable, double weightToShareRatio) {
      double share = schedulable.getWeight() * weightToShareRatio;
      int min = schedulable.getMinimum();
      int max = schedulable.getMaximum();
      int requested = schedulable.getRequested();
      share = Math.max(min, share);
      share = Math.min(max, share);
      share = Math.min(requested, share);
      return share;
    }
docs: Get the share of the schedulable given a weightToShareRatio.
  This takes into account the min and the max allocation and is used
  to compute the weightToShareRatio globally
  @param schedulable the schedulable to compute the share for
  @param weightToShareRatio the multiplier for the weight of the schedulable
  @return the share of the schedulable given a weightToShareRatio