CDSAnalytic { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final CDSAnalytic other = (CDSAnalytic) obj; if (Double.doubleToLongBits(_accStart) != Double.doubleToLongBits(other._accStart)) { return false; } if (Double.doubleToLongBits(_accrued) != Double.doubleToLongBits(other._accrued)) { return false; } if (_accruedDays != other._accruedDays) { return false; } if (Double.doubleToLongBits(_cashSettlementTime) != Double.doubleToLongBits(other._cashSettlementTime)) { return false; } if (!Arrays.equals(_coupons, other._coupons)) { return false; } if (Double.doubleToLongBits(_effectiveProtectionStart) != Double.doubleToLongBits(other._effectiveProtectionStart)) { return false; } if (Double.doubleToLongBits(_lgd) != Double.doubleToLongBits(other._lgd)) { return false; } if (_payAccOnDefault != other._payAccOnDefault) { return false; } if (Double.doubleToLongBits(_protectionEnd) != Double.doubleToLongBits(other._protectionEnd)) { return false; } return true; } CDSAnalytic(final LocalDate tradeDate, final LocalDate stepinDate, final LocalDate valueDate, final LocalDate accStartDate, final LocalDate endDate, final boolean payAccOnDefault,
      final Period paymentInterval, final StubType stubType, final boolean protectStart, final double recoveryRate);  CDSAnalytic(final LocalDate tradeDate, final LocalDate stepinDate, final LocalDate valueDate, final LocalDate accStartDate, final LocalDate endDate, final boolean payAccOnDefault,
      final Period paymentInterval, final StubType stubType, final boolean protectStart, final double recoveryRate, final BusinessDayConvention businessdayAdjustmentConvention,
      final Calendar calendar, final DayCount accrualDayCount);  CDSAnalytic(final LocalDate tradeDate, final LocalDate stepinDate, final LocalDate valueDate, final LocalDate accStartDate, final LocalDate endDate, final boolean payAccOnDefault,
      final Period paymentInterval, final StubType stubType, final boolean isProtectStart, final double recoveryRate, final BusinessDayConvention businessdayAdjustmentConvention,
      final Calendar calendar, final DayCount accrualDayCount, final DayCount curveDayCount); private  CDSAnalytic(final double lgd, final CDSCoupon[] coupons, final double start, final double effectiveProtectionStart, final double protectionEnd, final double valuationTime,
      final boolean payAccOnDefault, final double accrued, final int accruedDays); int getNumPayments(); boolean isPayAccOnDefault(); double getLGD(); double getCashSettleTime(); double getAccStart(); double getEffectiveProtectionStart(); double getProtectionEnd(); CDSCoupon[] getCoupons(); CDSCoupon getCoupon(final int index); double getAccruedYearFraction(); double getAccruedPremium(final double fractionalSpread); int getAccuredDays(); CDSAnalytic withRecoveryRate(final double recoveryRate); CDSAnalytic withOffset(final double offset); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test public void equalsTest() { final LocalDate tradeDate = LocalDate.of(2014, 2, 26); final Period term = Period.ofYears(5); final CDSAnalytic cds1 = FACTORY.makeIMMCDS(tradeDate, term); final CDSAnalytic cds2 = FACTORY.makeIMMCDS(tradeDate, term); assertEquals(cds1, cds2); final CDSAnalytic cds3 = FACTORY.withRecoveryRate(0.3).makeIMMCDS(tradeDate, term); assertFalse(cds1.equals(cds3)); final CDSAnalytic cds4 = cds3.withRecoveryRate(0.4); assertTrue(cds1.equals(cds4)); }