### Question:
DiscountingIborFutureProductPricer { public double price(ResolvedIborFuture future, RatesProvider ratesProvider) { IborIndexRates rates = ratesProvider.iborIndexRates(future.getIndex()); double forward = rates.rate(future.getIborRate().getObservation()); return 1.0 - forward; } DiscountingIborFutureProductPricer(); double price(ResolvedIborFuture future, RatesProvider ratesProvider); PointSensitivities priceSensitivity(ResolvedIborFuture future, RatesProvider ratesProvider); static final DiscountingIborFutureProductPricer DEFAULT; }### Answer:
@Test public void test_price() { IborIndexRates mockIbor = mock(IborIndexRates.class); SimpleRatesProvider prov = new SimpleRatesProvider(); prov.setIborRates(mockIbor); when(mockIbor.rate(FUTURE.getIborRate().getObservation())).thenReturn(RATE); assertThat(PRICER.price(FUTURE, prov)).isCloseTo(1.0 - RATE, offset(TOLERANCE_PRICE)); }