class DiscountingCmsLegPricer {

  public CurrencyAmount presentValue(
      ResolvedCmsLeg cmsLeg,
      RatesProvider ratesProvider) {

    return cmsLeg.getCmsPeriods()
        .stream()
        .map(cmsPeriod -> cmsPeriodPricer.presentValue(cmsPeriod, ratesProvider))
        .reduce((c1, c2) -> c1.plus(c2))
        .get();
  }

  public  DiscountingCmsLegPricer(DiscountingCmsPeriodPricer cmsPeriodPricer);

}