### Question:
IsdaCdsTradePricer { public CurrencyAmount presentValue( ResolvedCdsTrade trade, CreditRatesProvider ratesProvider, PriceType priceType, ReferenceData refData) { CurrencyAmount pvProduct = productPricer.presentValue( trade.getProduct(), ratesProvider, ratesProvider.getValuationDate(), priceType, refData); if (!trade.getUpfrontFee().isPresent()) { return pvProduct; } Payment upfront = trade.getUpfrontFee().get(); CurrencyAmount pvUpfront = upfrontPricer.presentValue(upfront, ratesProvider.discountFactors(upfront.getCurrency()).toDiscountFactors()); return pvProduct.plus(pvUpfront); } IsdaCdsTradePricer();  IsdaCdsTradePricer(AccrualOnDefaultFormula formula); AccrualOnDefaultFormula getAccrualOnDefaultFormula(); double price(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider,
      PriceType priceType,
      ReferenceData refData); PointSensitivities priceSensitivity(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider,
      ReferenceData refData); double parSpread(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider,
      ReferenceData refData); PointSensitivities parSpreadSensitivity(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider,
      ReferenceData refData); CurrencyAmount presentValue(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider,
      PriceType priceType,
      ReferenceData refData); PointSensitivities presentValueSensitivity(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider,
      ReferenceData refData); CurrencyAmount presentValueOnSettle(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider,
      PriceType priceType,
      ReferenceData refData); PointSensitivities presentValueOnSettleSensitivity(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider,
      ReferenceData refData); CurrencyAmount rpv01OnSettle(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider,
      PriceType priceType,
      ReferenceData refData); CurrencyAmount recovery01OnSettle(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider,
      ReferenceData refData); JumpToDefault jumpToDefault(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider,
      ReferenceData refData); CurrencyAmount expectedLoss(
      ResolvedCdsTrade trade,
      CreditRatesProvider ratesProvider); static final IsdaCdsTradePricer DEFAULT; }### Answer:
@Test public void test_presentValue() { CurrencyAmount computed = PRICER.presentValue(TRADE, RATES_PROVIDER, PriceType.CLEAN, REF_DATA); CurrencyAmount expected = PRICER_PRODUCT.presentValue(PRODUCT, RATES_PROVIDER, VALUATION_DATE, PriceType.CLEAN, REF_DATA) .plus(PRICER_PAYMENT.presentValue(UPFRONT, YIELD_CRVE.toDiscountFactors())); CurrencyAmount computedMf = PRICER_MF.presentValue(TRADE_NO_SETTLE_DATE, RATES_PROVIDER, PriceType.CLEAN, REF_DATA); CurrencyAmount expectedMf = PRICER_PRODUCT_MF.presentValue(PRODUCT, RATES_PROVIDER, VALUATION_DATE, PriceType.CLEAN, REF_DATA); assertThat(computed.getAmount()).isCloseTo(expected.getAmount(), offset(TOL)); assertThat(computedMf.getAmount()).isCloseTo(expectedMf.getAmount(), offset(TOL)); }