}
final Annuity<CouponFixed> unitCouponAnnuity = new Annuity<>(unitCoupons);
final double a = unitCouponAnnuity.accept(PV_CALCULATOR, curves);
final Map<String, List<DoublesPair>> senseA = unitCouponAnnuity.accept(PV_SENSITIVITY_CALCULATOR, curves);
final Map<String, List<DoublesPair>> result = new HashMap<>();
final PaymentFixed principlePayment = bond.getNominal().getNthPayment(0);
final double df = principlePayment.accept(PV_CALCULATOR, curves);
final double factor = -(1 - df) / a / a;
for (final String name : curves.getAllNames()) {
if (senseA.containsKey(name)) {
final List<DoublesPair> temp = new ArrayList<>();
final List<DoublesPair> list = senseA.get(name);
final int m = list.size();
for (int i = 0; i < (m - 1); i++) {
final DoublesPair pair = list.get(i);
temp.add(new DoublesPair(pair.getFirst(), factor * pair.getSecond()));
}
final DoublesPair pair = list.get(m - 1);
temp.add(new DoublesPair(pair.getFirst(), principlePayment.getPaymentTime() * df / a + factor * pair.getSecond()));
result.put(name, temp);
}
}
return result;
}