class DiscountingPaymentPricer {

  public PointSensitivityBuilder presentValueSensitivity(Payment payment, BaseProvider provider) {
    // duplicated code to avoid looking up in the provider when not necessary
    if (provider.getValuationDate().isAfter(payment.getDate())) {
      return PointSensitivityBuilder.none();
    }
    DiscountFactors discountFactors = provider.discountFactors(payment.getCurrency());
    return discountFactors.zeroRatePointSensitivity(payment.getDate()).multipliedBy(payment.getAmount());
  }

  public  DiscountingPaymentPricer();

}