CouponONArithmeticAverageSpreadSimplified extends Coupon { public static CouponONArithmeticAverageSpreadSimplified from(double paymentTime, double paymentAccrualFactor, double notional, IndexON index, final double fixingPeriodStartTime, double fixingPeriodEndTime, double fixingPeriodAccrualFactor, final double spread) { ArgumentChecker.notNull(index, "Index"); return new CouponONArithmeticAverageSpreadSimplified(index.getCurrency(), paymentTime, paymentAccrualFactor, notional, index, fixingPeriodStartTime, fixingPeriodEndTime, fixingPeriodAccrualFactor, spread); } private  CouponONArithmeticAverageSpreadSimplified(Currency currency, double paymentTime, double paymentYearFraction, double notional, IndexON index, final double fixingPeriodStartTime,
      double fixingPeriodEndTime, double fixingPeriodAccrualFactor, final double spread); static CouponONArithmeticAverageSpreadSimplified from(double paymentTime, double paymentAccrualFactor, double notional, IndexON index, final double fixingPeriodStartTime,
      double fixingPeriodEndTime, double fixingPeriodAccrualFactor, final double spread); IndexON getIndex(); double getSpread(); double getSpreadAmount(); double getFixingPeriodStartTime(); double getFixingPeriodEndTime(); double getFixingPeriodAccrualFactor(); @Override Coupon withNotional(double notional); @Override T accept(InstrumentDerivativeVisitor<S, T> visitor, S data); @Override T accept(InstrumentDerivativeVisitor<?, T> visitor); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void nullIndex() { CouponONArithmeticAverageSpreadSimplified.from(PAYMENT_TIME, FEDFUND_CPN_3M_2_DEF.getPaymentYearFraction(), NOTIONAL, null, ACCRUAL_START_TIME, ACCRUAL_END_TIME, ACCRUAL_FACTOR, SPREAD); }