BloombergCommodityFuturePriceCurveInstrumentProvider implements FuturePriceCurveInstrumentProvider<Number> { @Override public ExternalId getInstrument(final Number futureNumber) { throw new OpenGammaRuntimeException("Provider needs a curve date to create interest rate future identifier from futureNumber"); } BloombergCommodityFuturePriceCurveInstrumentProvider(final String futurePrefix, final String postfix, final String dataFieldName, String tickerScheme);  BloombergCommodityFuturePriceCurveInstrumentProvider(final String futurePrefix, final String postfix, final String dataFieldName); static Map<String, ExchangeTradedInstrumentExpiryCalculator> getExpiryRules(); @Override ExternalId getInstrument(final Number futureNumber); @Override /** * Provides an ExternalID for Bloomberg ticker, * given a reference date and an integer offset, the n'th subsequent option <p> * The format is prefix + postfix <p> * e.g. S U3 Comdty * <p> * @param futureOptionNumber n'th future following curve date, not null * @param curveDate date of future validity; valuation date, not null * @return the id of the Bloomberg ticker */ ExternalId getInstrument(final Number futureNumber, final LocalDate curveDate); String getFuturePrefix(); String getPostfix(); @Override String getTickerScheme(); @Override String getDataFieldName(); @Override int hashCode(); @Override boolean equals(final Object obj); @Override ExchangeTradedInstrumentExpiryCalculator getExpiryRuleCalculator();  }
@Test public void testFuturePriceCurveInstrumentProvider() { for (int i = 0; i < EXPIRY_OFFSETS.length; i++) { final String expected = RESULTS[i]; final ExternalId actual = PROVIDER.getInstrument(EXPIRY_OFFSETS[i], DATE_AFTER_FIFTEENTH); assertEquals(ExternalSchemes.BLOOMBERG_TICKER_WEAK, actual.getScheme()); assertEquals(expected, actual.getValue()); } }