public static Map<String, List<ForwardSensitivity>> cleanedFwd(
     final Map<String, List<ForwardSensitivity>> map) {
   // TODO: improve the sorting algorithm.
   final Map<String, List<ForwardSensitivity>> result = new HashMap<>();
   for (final Map.Entry<String, List<ForwardSensitivity>> entry : map.entrySet()) {
     final List<ForwardSensitivity> list = entry.getValue();
     final List<ForwardSensitivity> listClean = new ArrayList<>();
     final Set<Triple<Double, Double, Double>> set = new TreeSet<>();
     for (final ForwardSensitivity pair : list) {
       set.add(new Triple<>(pair.getStartTime(), pair.getEndTime(), pair.getAccrualFactor()));
     }
     for (final Triple<Double, Double, Double> time : set) {
       double sensi = 0;
       for (int looplist = 0; looplist < list.size(); looplist++) {
         final ForwardSensitivity fwdSensitivity = list.get(looplist);
         final Triple<Double, Double, Double> triple =
             new Triple<>(
                 fwdSensitivity.getStartTime(),
                 fwdSensitivity.getEndTime(),
                 fwdSensitivity.getAccrualFactor());
         if (triple.equals(time)) {
           sensi += list.get(looplist).getValue();
         }
       }
       listClean.add(
           new ForwardSensitivity(time.getFirst(), time.getSecond(), time.getThird(), sensi));
     }
     result.put(entry.getKey(), listClean);
   }
   return result;
 }
 @Override
 public CompiledFunctionDefinition compile(
     FunctionCompilationContext context, InstantProvider atInstant) {
   Triple<InstantProvider, InstantProvider, InterpolatedYieldCurveSpecification> compile =
       _helper.compile(context, atInstant);
   return new CompiledImpl(
       compile.getFirst(),
       compile.getSecond(),
       buildRequirements(compile.getThird(), context),
       _helper.getYieldCurveKey());
 }
 @Override
 public Double getValue(Triple<Double, Double, Double> xyz) {
   Validate.notNull(xyz, "xyz");
   Double x = xyz.getFirst();
   Validate.notNull(x, "x");
   Double y = xyz.getSecond();
   Validate.notNull(y, "y");
   Double z = xyz.getThird();
   Validate.notNull(z, "z");
   return _interpolator.interpolate(_dataBundle, new double[] {x, y, z});
 }