code: private long makeUpRuntime(List<LoggedDiscreteCDF> mapAttemptCDFs) {
      int total = 0;
      for (LoggedDiscreteCDF cdf : mapAttemptCDFs) {
        total += cdf.getNumberValues();
      }
      if (total == 0) {
        return -1;
      }
      int index = random.nextInt(total);
      for (LoggedDiscreteCDF cdf : mapAttemptCDFs) {
        if (index >= cdf.getNumberValues()) {
          index -= cdf.getNumberValues();
        } else {
          if (index < 0) {
            throw new IllegalStateException("application error");
          }
          return makeUpRuntime(cdf);
        }
      }
      throw new IllegalStateException("not possible to get here");
    }
docs: Perform a weighted random selection on a list of CDFs, and produce a random
  variable using the selected CDF.
  
  @param mapAttemptCDFs
  A list of CDFs for the distribution of runtime for the 1st, 2nd,
  ... map attempts for the job.