BondFutureDiscountingMethod extends BondFutureMethod { public double price(final BondFuture future, final IssuerProviderInterface issuerMulticurves) { return priceFromNetBasis(future, issuerMulticurves, 0.0); } private  BondFutureDiscountingMethod(); static BondFutureDiscountingMethod getInstance(); double price(final BondFuture future, final IssuerProviderInterface issuerMulticurves); double priceFromNetBasis(final BondFuture future, final IssuerProviderInterface issuerMulticurves, final double netBasis); MultipleCurrencyAmount presentValue(final BondFuture future, final IssuerProviderInterface issuerMulticurves); MultipleCurrencyAmount presentValueFromNetBasis(final BondFuture future, final IssuerProviderInterface issuerMulticurves, final double netBasis); MulticurveSensitivity priceCurveSensitivity(final BondFuture future, final IssuerProviderInterface issuerMulticurves); MultipleCurrencyMulticurveSensitivity presentValueCurveSensitivity(final BondFuture future, final IssuerProviderInterface issuerMulticurves); double[] grossBasisFromPrices(final BondFuture future, final double[] cleanPrices, final double futurePrice); double[] grossBasisFromCurves(final BondFuture future, final IssuerProviderInterface issuerMulticurves, final double futurePrice); double[] netBasisAllBonds(final BondFuture future, final IssuerProviderInterface issuerMulticurves, final double futurePrice); double netBasisCheapest(final BondFuture future, final IssuerProviderInterface issuerMulticurves, final double futurePrice);  }
@Test public void price() { final double priceComputed = METHOD_FUT_DSC.price(BOND_FUTURE, ISSUER_MULTICURVES); final double[] bondForwardPrice = new double[NB_BOND]; final double[] bondForwardPriceAdjusted = new double[NB_BOND]; double priceExpected = 2.0; for (int loopbasket = 0; loopbasket < NB_BOND; loopbasket++) { bondForwardPrice[loopbasket] = METHOD_BOND.cleanPriceFromCurves(BASKET[loopbasket], ISSUER_MULTICURVES); bondForwardPriceAdjusted[loopbasket] = bondForwardPrice[loopbasket] / CONVERSION_FACTOR[loopbasket]; priceExpected = Math.min(priceExpected, bondForwardPriceAdjusted[loopbasket]); } assertEquals("Bond future security Discounting Method: price from curves", priceExpected, priceComputed, TOLERANCE_PRICE); }