class DiscountingCmsLegPricer {

  public PointSensitivityBuilder presentValueSensitivity(
      ResolvedCmsLeg cmsLeg,
      RatesProvider ratesProvider) {

    return cmsLeg.getCmsPeriods()
        .stream()
        .map(cmsPeriod -> cmsPeriodPricer.presentValueSensitivity(cmsPeriod, ratesProvider))
        .reduce((p1, p2) -> p1.combinedWith(p2))
        .get();
  }

  public  DiscountingCmsLegPricer(DiscountingCmsPeriodPricer cmsPeriodPricer);

}