PV01CurveParametersCalculator extends InstrumentDerivativeVisitorSameMethodAdapter<T, ReferenceAmount<Pair<String, Currency>>> { @Override public ReferenceAmount<Pair<String, Currency>> visit(final InstrumentDerivative ird, final T multicurves) { ArgumentChecker.notNull(ird, "derivative"); ArgumentChecker.notNull(multicurves, "multicurves"); final MultipleCurrencyParameterSensitivity sensi = _parameterSensitivityCalculator.calculateSensitivity(ird, multicurves); return pv01CurveParameters(sensi); } PV01CurveParametersCalculator(final InstrumentDerivativeVisitor<T, MultipleCurrencyMulticurveSensitivity> curveSensitivityCalculator); @Override ReferenceAmount<Pair<String, Currency>> visit(final InstrumentDerivative ird, final T multicurves); ReferenceAmount<Pair<String, Currency>> pv01CurveParameters(final MultipleCurrencyParameterSensitivity sensi); @Override ReferenceAmount<Pair<String, Currency>> visit(final InstrumentDerivative derivative);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullInstrument1() { PV01.visit(null, MULTICURVES); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullInstrument2() { GAMMA_PV01.visit(null, MULTICURVES); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullData1() { PV01.visit(SWAP_FIXED_IBOR, null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullData2() { GAMMA_PV01.visit(SWAP_FIXED_IBOR, null); }
@Test(expectedExceptions = UnsupportedOperationException.class) public void testVisit1() { PV01.visit(SWAP_FIXED_IBOR); }
@Test(expectedExceptions = UnsupportedOperationException.class) public void testVisit2() { GAMMA_PV01.visit(SWAP_FIXED_IBOR); }