### Question:
MarketQuoteSensitivityCalculator { public CurrencyParameterSensitivities sensitivity( CurrencyParameterSensitivities paramSensitivities, RatesProvider provider) { ArgChecker.notNull(paramSensitivities, "paramSensitivities"); ArgChecker.notNull(provider, "provider"); CurrencyParameterSensitivities result = CurrencyParameterSensitivities.empty(); for (CurrencyParameterSensitivity paramSens : paramSensitivities.getSensitivities()) { Curve curve = provider.findData(paramSens.getMarketDataName()) .filter(v -> v instanceof Curve) .map(v -> (Curve) v) .orElseThrow(() -> new IllegalArgumentException( "Market Quote sensitivity requires curve: " + paramSens.getMarketDataName())); JacobianCalibrationMatrix info = curve.getMetadata().findInfo(CurveInfoType.JACOBIAN) .orElseThrow(() -> new IllegalArgumentException( "Market Quote sensitivity requires Jacobian calibration information")); DoubleMatrix jacobian = info.getJacobianMatrix(); DoubleArray paramSensMatrix = paramSens.getSensitivity(); DoubleArray marketQuoteSensMatrix = (DoubleArray) MATRIX_ALGEBRA.multiply(paramSensMatrix, jacobian); DoubleArray marketQuoteSens = marketQuoteSensMatrix; Map<CurveName, DoubleArray> split = info.splitValues(marketQuoteSens); for (Entry<CurveName, DoubleArray> entry : split.entrySet()) { CurveName curveName = entry.getKey(); CurrencyParameterSensitivity maketQuoteSens = provider.findData(curveName) .map(c -> c.createParameterSensitivity(paramSens.getCurrency(), entry.getValue())) .orElse(CurrencyParameterSensitivity.of(curveName, paramSens.getCurrency(), entry.getValue())); result = result.combinedWith(maketQuoteSens); } } return result; }  CurrencyParameterSensitivities sensitivity(
      CurrencyParameterSensitivities paramSensitivities,
      RatesProvider provider); CurrencyParameterSensitivities sensitivity(
      CurrencyParameterSensitivities paramSensitivities,
      LegalEntityDiscountingProvider provider); CurrencyParameterSensitivities sensitivity(
      CurrencyParameterSensitivities paramSensitivities,
      CreditRatesProvider provider); static final MarketQuoteSensitivityCalculator DEFAULT; }### Answer:
@Test public void test_sensitivity_LegalEntityDiscountingProvider() { CurrencyParameterSensitivities computed = CALC.sensitivity(PARAMETER_SENSITIVITIES, PROVIDER); assertThat(computed.getSensitivities()).hasSize(4); DoubleArray expected11 = (DoubleArray) MATRIX_ALGEBRA.multiply(SENSI_1, DoubleMatrix.copyOf(MATRIX_11)); DoubleArray expected12 = (DoubleArray) MATRIX_ALGEBRA.multiply(SENSI_1, DoubleMatrix.copyOf(MATRIX_12)); DoubleArray expected21 = (DoubleArray) MATRIX_ALGEBRA.multiply(SENSI_2, DoubleMatrix.copyOf(MATRIX_21)); DoubleArray expected22 = (DoubleArray) MATRIX_ALGEBRA.multiply(SENSI_2, DoubleMatrix.copyOf(MATRIX_22)); assertThat(computed.getSensitivity(CURVE_NAME_1, USD).getSensitivity().equalWithTolerance(expected11, TOL)).isTrue(); assertThat(computed.getSensitivity(CURVE_NAME_1, GBP).getSensitivity().equalWithTolerance(expected21, TOL)).isTrue(); assertThat(computed.getSensitivity(CURVE_NAME_2, USD).getSensitivity().equalWithTolerance(expected12, TOL)).isTrue(); assertThat(computed.getSensitivity(CURVE_NAME_2, GBP).getSensitivity().equalWithTolerance(expected22, TOL)).isTrue(); }