code: private DateTime getCachedOnset(final Date date) {
          int index = Arrays.binarySearch(onsetsMillisec, date.getTime());
          if (index >= 0) {
              return onsetsDates[index];
          } else {
              int insertionIndex = -index - 1;
              return onsetsDates[insertionIndex - 1];
          }
      }
docs: Returns a cached onset for the specified date.
  
  @param date
  @return a cached onset date or null if no cached onset is applicable for the specified date