### Question:
DiscountingFxSwapProductPricer { public PointSensitivities parSpreadSensitivity(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(); double ps = -pvCounterCcy / (notionalBaseCcy * dfEnd); double psBar = 1d; double pvCounterCcyBar = -1d / (notionalBaseCcy * dfEnd) * psBar; double dfEndBar = -ps / dfEnd * psBar; ZeroRateSensitivity ddfEnddr = provider.discountFactors(counterPaymentNear.getCurrency()) .zeroRatePointSensitivity(swap.getFarLeg().getPaymentDate()); PointSensitivities result = ddfEnddr.multipliedBy(dfEndBar).build(); PointSensitivities dpvdr = presentValueSensitivity(swap, provider); PointSensitivities dpvdrConverted = dpvdr.convertedTo(counterPaymentNear.getCurrency(), provider); return result.combinedWith(dpvdrConverted.multipliedBy(pvCounterCcyBar)); } 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_parSpreadSensitivity_ended() { ResolvedFxSwap product = ResolvedFxSwap.ofForwardPoints( CurrencyAmount.of(USD, NOMINAL_USD), KRW, FX_RATE, FX_FWD_POINTS, PAYMENT_DATE_LONG_PAST, PAYMENT_DATE_PAST); PointSensitivities pts = PRICER.parSpreadSensitivity(product, PROVIDER); CurrencyParameterSensitivities computed = PROVIDER.parameterSensitivity(pts); assertThat(computed.equalWithTolerance(CurrencyParameterSensitivities.empty(), TOLERANCE_SPREAD_DELTA)).isTrue(); }