### Question:
DiscountingFxSwapProductPricer { public double parSpread(ResolvedFxSwap swap, RatesProvider provider) { Payment counterPaymentNear = swap.getNearLeg().getCounterCurrencyPayment(); MultiCurrencyAmount pv = presentValue(swap, provider); double pvCounterCcy = pv.convertedTo(counterPaymentNear.getCurrency(), provider).getAmount(); double dfEnd = provider.discountFactor(counterPaymentNear.getCurrency(), swap.getFarLeg().getPaymentDate()); double notionalBaseCcy = swap.getNearLeg().getBaseCurrencyPayment().getAmount(); return -pvCounterCcy / (notionalBaseCcy * dfEnd); } DiscountingFxSwapProductPricer(
      DiscountingFxSingleProductPricer fxPricer); MultiCurrencyAmount presentValue(ResolvedFxSwap swap, RatesProvider provider); PointSensitivities presentValueSensitivity(ResolvedFxSwap swap, RatesProvider provider); double parSpread(ResolvedFxSwap swap, RatesProvider provider); PointSensitivities parSpreadSensitivity(ResolvedFxSwap swap, RatesProvider provider); MultiCurrencyAmount currencyExposure(ResolvedFxSwap product, RatesProvider provider); MultiCurrencyAmount currentCash(ResolvedFxSwap swap, LocalDate valuationDate); static final DiscountingFxSwapProductPricer DEFAULT; }### Answer:
@Test public void test_parSpread_ended() { ResolvedFxSwap product = ResolvedFxSwap.ofForwardPoints( CurrencyAmount.of(USD, NOMINAL_USD), KRW, FX_RATE, FX_FWD_POINTS, PAYMENT_DATE_LONG_PAST, PAYMENT_DATE_PAST); double parSpread = PRICER.parSpread(product, PROVIDER); assertThat(parSpread).isCloseTo(0d, offset(TOL)); }