@Test public void testObject() { final ParameterSensitivityCalculator other = new ParameterSensitivityCalculator(SENSITIVITY_IRS_CALCULATOR); assertEquals(NODE_CALCULATOR, other); assertEquals(NODE_CALCULATOR.hashCode(), other.hashCode()); }
@Test public void testPresentValue() { final InstrumentDerivativeVisitor<YieldCurveBundle, Double> valueCalculator = PresentValueCalculator.getInstance(); final DoubleMatrix1D result = NODE_CALCULATOR.calculateSensitivity(SWAP, new HashSet<String>(), CURVE_BUNDLE_YIELD); final DoubleMatrix1D fdresult = finiteDiffNodeSensitivitiesYield(SWAP, valueCalculator, null, CURVE_BUNDLE_YIELD); assertArrayEquals(result.getData(), fdresult.getData(), TOLERANCE_SENSI); }