code: private int startIndex(Date start) {
          int lastIndex = ranges.size();
  
          for (int i = 0; i < ranges.size(); i++) {
              Range r = ranges.get(i);
              if (start.before(r.start)) {
                  break;
              }
              lastIndex = i;
          }
          return lastIndex;
      }
docs: /*
  find the index of the last range whose start date is before "start"
  returns an index >= ranges.size() if there is none