CouponONArithmeticAverageSpread extends Coupon { public static CouponONArithmeticAverageSpread from(final double paymentTime, final double paymentAccrualFactor, final double notional, final IndexON index, final double[] fixingPeriodTimes, final double[] fixingPeriodAccrualFactors, final double rateAccrued, final double spread) { ArgumentChecker.notNull(index, "Index"); ArgumentChecker.notNull(fixingPeriodTimes, "Fixing Times"); ArgumentChecker.notNull(fixingPeriodAccrualFactors, "Accrual Factors"); double fixingPeriodRemainingAccrualFactor = 0.0; for (final double fixingPeriodAccrualFactor : fixingPeriodAccrualFactors) { fixingPeriodRemainingAccrualFactor += fixingPeriodAccrualFactor; } return new CouponONArithmeticAverageSpread(index.getCurrency(), paymentTime, paymentAccrualFactor, notional, index, fixingPeriodTimes, fixingPeriodAccrualFactors, rateAccrued, fixingPeriodRemainingAccrualFactor, spread); } private  CouponONArithmeticAverageSpread(final Currency currency, final double paymentTime, final double paymentYearFraction, final double notional, final IndexON index,
      final double[] fixingPeriodTimes, final double[] fixingPeriodAccrualFactors, final double rateAccrued, final double fixingPeriodRemainingAccrualFactor, final double spread); static CouponONArithmeticAverageSpread from(final double paymentTime, final double paymentAccrualFactor, final double notional, final IndexON index, final double[] fixingPeriodTimes,
      final double[] fixingPeriodAccrualFactors,
      final double rateAccrued, final double spread); IndexON getIndex(); double[] getFixingPeriodTimes(); double[] getFixingPeriodAccrualFactors(); double getRateAccrued(); double getFixingPeriodRemainingAccrualFactor(); double getSpread(); double getSpreadAmount(); @Override Coupon withNotional(final double notional); @Override T accept(final InstrumentDerivativeVisitor<S, T> visitor, final S data); @Override T accept(final InstrumentDerivativeVisitor<?, T> visitor); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void nullFixAF() { CouponONArithmeticAverageSpread.from(PAYMENT_TIME, FEDFUND_CPN_3M_2_DEF.getPaymentYearFraction(), NOTIONAL, FEDFUND, FIXING_TIMES, null, ACCRUED_RATE, SPREAD); }