@Override
 public boolean equals(Object obj) {
   if (obj == this) {
     return true;
   }
   if (obj != null && obj.getClass() == this.getClass()) {
     OvernightCompoundedRateObservation other = (OvernightCompoundedRateObservation) obj;
     return JodaBeanUtils.equal(getIndex(), other.getIndex())
         && JodaBeanUtils.equal(getStartDate(), other.getStartDate())
         && JodaBeanUtils.equal(getEndDate(), other.getEndDate())
         && (getRateCutOffDays() == other.getRateCutOffDays());
   }
   return false;
 }
 /**
  * Creates an {@code OvernightCompoundedRateObservation} from an index, period dates and rate
  * cut-off.
  *
  * <p>Rate cut-off applies if the cut-off is 2 or greater.
  *
  * @param index the index
  * @param startDate the first date of the period
  * @param endDate the last date of the period
  * @param rateCutOffDays the rate cut-off days offset, not negative
  * @return the Overnight compounded rate
  */
 public static OvernightCompoundedRateObservation of(
     OvernightIndex index, LocalDate startDate, LocalDate endDate, int rateCutOffDays) {
   return OvernightCompoundedRateObservation.builder()
       .index(index)
       .startDate(startDate)
       .endDate(endDate)
       .rateCutOffDays(rateCutOffDays)
       .build();
 }
 /**
  * Restricted copy constructor.
  *
  * @param beanToCopy the bean to copy from, not null
  */
 private Builder(OvernightCompoundedRateObservation beanToCopy) {
   this.index = beanToCopy.getIndex();
   this.startDate = beanToCopy.getStartDate();
   this.endDate = beanToCopy.getEndDate();
   this.rateCutOffDays = beanToCopy.getRateCutOffDays();
 }