### Question:
DiscountingFxSingleProductPricer { public double parSpread(ResolvedFxSingle fx, RatesProvider provider) { Payment basePayment = fx.getBaseCurrencyPayment(); Payment counterPayment = fx.getCounterCurrencyPayment(); MultiCurrencyAmount pv = presentValue(fx, provider); double pvCounterCcy = pv.convertedTo(counterPayment.getCurrency(), provider).getAmount(); double dfEnd = provider.discountFactor(counterPayment.getCurrency(), fx.getPaymentDate()); double notionalBaseCcy = basePayment.getAmount(); return pvCounterCcy / (notionalBaseCcy * dfEnd); } DiscountingFxSingleProductPricer(
      DiscountingPaymentPricer paymentPricer); MultiCurrencyAmount presentValue(ResolvedFxSingle fx, RatesProvider provider); PointSensitivities presentValueSensitivity(ResolvedFxSingle fx, RatesProvider provider); double parSpread(ResolvedFxSingle fx, RatesProvider provider); MultiCurrencyAmount currencyExposure(ResolvedFxSingle product, RatesProvider provider); MultiCurrencyAmount currentCash(ResolvedFxSingle fx, LocalDate valuationDate); FxRate forwardFxRate(ResolvedFxSingle fx, RatesProvider provider); PointSensitivityBuilder forwardFxRatePointSensitivity(ResolvedFxSingle fx, RatesProvider provider); double forwardFxRateSpotSensitivity(ResolvedFxSingle fx, RatesProvider provider); static final DiscountingFxSingleProductPricer DEFAULT; }### Answer:
@Test public void test_parSpread_ended() { ResolvedFxSingle fwd = ResolvedFxSingle.of(CurrencyAmount.of(USD, NOMINAL_USD), FxRate.of(USD, KRW, FX_RATE), PAYMENT_DATE_PAST); double spread = PRICER.parSpread(fwd, PROVIDER); assertThat(spread).isCloseTo(0d, offset(TOL)); }