@Override
 public Set<ComputedValue> execute(
     final FunctionExecutionContext context,
     final FunctionInputs inputs,
     final ComputationTarget target,
     final Set<ValueRequirement> desiredValues)
     throws AsynchronousExecution {
   final MultipleCurrencyParameterSensitivity sensitivities =
       (MultipleCurrencyParameterSensitivity) inputs.getValue(BLOCK_CURVE_SENSITIVITIES);
   final ValueRequirement desiredValue = desiredValues.iterator().next();
   final ValueProperties properties = desiredValue.getConstraints();
   final String desiredCurveName = desiredValue.getConstraint(CURVE);
   final Map<Pair<String, Currency>, DoubleMatrix1D> entries = sensitivities.getSensitivities();
   final Set<ComputedValue> results = new HashSet<>();
   for (final Map.Entry<Pair<String, Currency>, DoubleMatrix1D> entry : entries.entrySet()) {
     final String curveName = entry.getKey().getFirst();
     if (desiredCurveName.equals(curveName)) {
       final ValueProperties curveSpecificProperties =
           properties.copy().withoutAny(CURVE).with(CURVE, curveName).get();
       final CurveDefinition curveDefinition =
           (CurveDefinition)
               inputs.getValue(
                   new ValueRequirement(
                       CURVE_DEFINITION,
                       ComputationTargetSpecification.NULL,
                       ValueProperties.builder().with(CURVE, curveName).get()));
       final DoubleLabelledMatrix1D ycns =
           MultiCurveUtils.getLabelledMatrix(entry.getValue(), curveDefinition);
       final ValueSpecification spec =
           new ValueSpecification(
               YIELD_CURVE_NODE_SENSITIVITIES, target.toSpecification(), curveSpecificProperties);
       results.add(new ComputedValue(spec, ycns));
       return results;
     }
   }
   s_logger.info(
       "Could not get sensitivities to " + desiredCurveName + " for " + target.getName());
   return Collections.emptySet();
 }
 @Test(enabled = false)
 /** Tests present value curve sensitivity when the valuation date is on trade date. */
 public void presentValueCurveSensitivityStability() {
   // 5Yx5Y
   final MultipleCurrencyParameterSensitivity pvpsExact =
       PS_HW_C.calculateSensitivity(
           SWAPTION_SHORT_RECEIVER,
           HW_MULTICURVES,
           HW_MULTICURVES.getMulticurveProvider().getAllNames());
   final double derivativeExact = pvpsExact.totalSensitivity(MULTICURVES.getFxRates(), EUR);
   final double startingShift = 1.0E-4;
   final double ratio = Math.sqrt(2.0);
   final int nbShift = 55;
   final double[] eps = new double[nbShift + 1];
   final double[] derivative_FD = new double[nbShift];
   final double[] diff = new double[nbShift];
   eps[0] = startingShift;
   for (int loopshift = 0; loopshift < nbShift; loopshift++) {
     final ParameterSensitivityHullWhiteDiscountInterpolatedFDCalculator fdShift =
         new ParameterSensitivityHullWhiteDiscountInterpolatedFDCalculator(PVHWC, eps[loopshift]);
     final MultipleCurrencyParameterSensitivity pvpsFD =
         fdShift.calculateSensitivity(SWAPTION_SHORT_RECEIVER, HW_MULTICURVES);
     derivative_FD[loopshift] = pvpsFD.totalSensitivity(MULTICURVES.getFxRates(), EUR);
     diff[loopshift] = derivative_FD[loopshift] - derivativeExact;
     eps[loopshift + 1] = eps[loopshift] / ratio;
   }
   // 1Mx5Y
   final Period expirationPeriod =
       Period.ofDays(
           1); // Period.ofDays(1); Period.ofDays(7); Period.ofMonths(1); Period.ofYears(1);
   // Period.ofYears(10);
   final ZonedDateTime expiryDateExp =
       ScheduleCalculator.getAdjustedDate(REFERENCE_DATE, expirationPeriod, EURIBOR6M, CALENDAR);
   final ZonedDateTime settlementDateExp =
       ScheduleCalculator.getAdjustedDate(expiryDateExp, SPOT_LAG, CALENDAR);
   final double ATM = 0.0151; //  1W: 1.52% - 1M: 1.52% - 1Y: 1.51% - 10Y: 1.51%
   final SwapFixedIborDefinition swapExpx5YDefinition =
       SwapFixedIborDefinition.from(
           settlementDateExp, SWAP_TENOR, EUR1YEURIBOR6M, NOTIONAL, ATM, !FIXED_IS_PAYER);
   final SwaptionPhysicalFixedIborDefinition swaptionExpx5YDefinition =
       SwaptionPhysicalFixedIborDefinition.from(EXPIRY_DATE, swapExpx5YDefinition, !IS_LONG);
   final SwaptionPhysicalFixedIbor swaptionExpx5Y =
       swaptionExpx5YDefinition.toDerivative(REFERENCE_DATE);
   //    final double forward = swaptionExpx5Y.getUnderlyingSwap().accept(PRDC, MULTICURVES);
   final MultipleCurrencyParameterSensitivity pvpsExactExp =
       PS_HW_C.calculateSensitivity(
           swaptionExpx5Y, HW_MULTICURVES, HW_MULTICURVES.getMulticurveProvider().getAllNames());
   final double derivativeExactExp = pvpsExactExp.totalSensitivity(MULTICURVES.getFxRates(), EUR);
   final double[] derivative_FDExp = new double[nbShift];
   final double[] diffExp = new double[nbShift];
   for (int loopshift = 0; loopshift < nbShift; loopshift++) {
     final ParameterSensitivityHullWhiteDiscountInterpolatedFDCalculator fdShift =
         new ParameterSensitivityHullWhiteDiscountInterpolatedFDCalculator(PVHWC, eps[loopshift]);
     final MultipleCurrencyParameterSensitivity pvpsFD =
         fdShift.calculateSensitivity(swaptionExpx5Y, HW_MULTICURVES);
     derivative_FDExp[loopshift] = pvpsFD.totalSensitivity(MULTICURVES.getFxRates(), EUR);
     diffExp[loopshift] = derivative_FDExp[loopshift] - derivativeExactExp;
   }
   //    int t = 0;
   //    t++;
 }