//------------------------------------------------------------------------- public virtual void test_compareKey() { InflationRateSensitivity a1 = InflationRateSensitivity.of(GB_HICP_OBS, 32d); InflationRateSensitivity a2 = InflationRateSensitivity.of(GB_HICP_OBS, 32d); InflationRateSensitivity b = InflationRateSensitivity.of(CH_CPI_OBS, 32d); InflationRateSensitivity c = InflationRateSensitivity.of(GB_HICP_OBS, USD, 32d); InflationRateSensitivity d = InflationRateSensitivity.of(PriceIndexObservation.of(GB_HICP, YearMonth.of(2015, 10)), 32d); ZeroRateSensitivity other = ZeroRateSensitivity.of(GBP, 2d, 32d); assertEquals(a1.compareKey(a2), 0); assertEquals(a1.compareKey(b) > 0, true); assertEquals(b.compareKey(a1) < 0, true); assertEquals(a1.compareKey(c) < 0, true); assertEquals(c.compareKey(a1) > 0, true); assertEquals(a1.compareKey(d) < 0, true); assertEquals(d.compareKey(a1) > 0, true); assertEquals(a1.compareKey(other) < 0, true); assertEquals(other.compareKey(a1) > 0, true); }