SensitivityAndReturnDataBundle { public DoubleTimeSeries<?> getReturnTimeSeriesForUnderlying(final UnderlyingType type) { Validate.notNull(type, "underlying"); final DoubleTimeSeries<?> result = _underlyingReturnTS.get(type); Validate.notNull(result, "underlying return time series for " + type); return result; } SensitivityAndReturnDataBundle(final Sensitivity<?> sensitivity, final double value, final Map<UnderlyingType, DoubleTimeSeries<?>> underlyingReturnTS); Sensitivity<?> getSensitivity(); double getValue(); Map<UnderlyingType, DoubleTimeSeries<?>> getUnderlyingReturnTS(); List<UnderlyingType> getUnderlyingTypes(); Underlying getUnderlying(); DoubleTimeSeries<?> getReturnTimeSeriesForUnderlying(final UnderlyingType type); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullUnderlyingType() { DATA.getReturnTimeSeriesForUnderlying(null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testWrongUnderlyingType() { DATA.getReturnTimeSeriesForUnderlying(UnderlyingType.BOND_YIELD); }