### Question:
DiscountingOvernightFutureProductPricer { double marginIndex(ResolvedOvernightFuture future, double price) { return price * future.getNotional() * future.getAccrualFactor(); } DiscountingOvernightFutureProductPricer(RateComputationFn<RateComputation> rateComputationFn); double price(ResolvedOvernightFuture future, RatesProvider ratesProvider); PointSensitivities priceSensitivity(ResolvedOvernightFuture future, RatesProvider ratesProvider); static final DiscountingOvernightFutureProductPricer DEFAULT; }### Answer:
@Test public void test_marginIndex() { double notional = FUTURE.getNotional(); double accrualFactor = FUTURE.getAccrualFactor(); double price = 0.99; double marginIndexExpected = price * notional * accrualFactor; double marginIndexComputed = PRICER.marginIndex(FUTURE, price); assertThat(marginIndexComputed).isEqualTo(marginIndexExpected); }