CouponONArithmeticAverage extends Coupon { public static CouponONArithmeticAverage from(final double paymentTime, final double paymentAccrualFactor, final double notional, final IndexON index, final double[] fixingPeriodStartTimes, final double[] fixingPeriodEndTimes, final double[] fixingPeriodAccrualFactors, final double rateAccrued) { ArgumentChecker.notNull(index, "Index"); ArgumentChecker.notNull(fixingPeriodStartTimes, "Fixing Start Times"); ArgumentChecker.notNull(fixingPeriodEndTimes, "Fixing End Times"); ArgumentChecker.notNull(fixingPeriodAccrualFactors, "Accrual Factors"); double fixingPeriodRemainingAccrualFactor = 0.0; for (final double fixingPeriodAccrualFactor : fixingPeriodAccrualFactors) { fixingPeriodRemainingAccrualFactor += fixingPeriodAccrualFactor; } return new CouponONArithmeticAverage(index.getCurrency(), paymentTime, paymentAccrualFactor, notional, index, fixingPeriodStartTimes, fixingPeriodEndTimes, fixingPeriodAccrualFactors, rateAccrued, fixingPeriodRemainingAccrualFactor); } private  CouponONArithmeticAverage(final Currency currency, final double paymentTime, final double paymentYearFraction, final double notional, final IndexON index,
      final double[] fixingPeriodStartTimes,
      final double[] fixingPeriodEndTimes, final double[] fixingPeriodAccrualFactors, final double rateAccrued, final double fixingPeriodRemainingAccrualFactor); static CouponONArithmeticAverage from(final double paymentTime, final double paymentAccrualFactor, final double notional, final IndexON index, final double[] fixingPeriodStartTimes,
      final double[] fixingPeriodEndTimes, final double[] fixingPeriodAccrualFactors,
      final double rateAccrued); IndexON getIndex(); double[] getFixingPeriodStartTimes(); double[] getFixingPeriodEndTimes(); double[] getFixingPeriodAccrualFactors(); double getRateAccrued(); double getFixingPeriodRemainingAccrualFactor(); @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() { CouponONArithmeticAverage.from(PAYMENT_TIME, FEDFUND_CPN_3M_2_DEF.getPaymentYearFraction(), NOTIONAL, FEDFUND, FIXING_START_TIMES, FIXING_END_TIMES, null, ACCRUED_RATE); }