BloombergEquityFuturePriceCurveInstrumentProvider 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"); } BloombergEquityFuturePriceCurveInstrumentProvider(final String futurePrefix, final String postfix, final String dataFieldName, final String tickerScheme, final String exchange);  BloombergEquityFuturePriceCurveInstrumentProvider(final String futurePrefix, final String postfix, final String dataFieldName, final String exchange); static Map<?, ?> 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. AAPL=G3 OC Equity * <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); @Override ExchangeTradedInstrumentExpiryCalculator getExpiryRuleCalculator(); String getFuturePrefix(); String getPostfix(); @Override String getTickerScheme(); @Override String getDataFieldName(); String getExchange(); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@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); assertEquals(ExternalSchemes.BLOOMBERG_TICKER_WEAK, actual.getScheme()); assertEquals(expected, actual.getValue()); } }