CurveDefinitionAndSpecifications { public static Map<Tenor, CurveInstrumentProvider> buildStandardBloombergLiborInstrumentProvider(final String prefix, final String overnightString, final String twoDayString) { final Map<Tenor, CurveInstrumentProvider> provider = new LinkedHashMap<>(); provider.put(Tenor.ofDays(1), new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(prefix + "00" + overnightString + " Index"))); provider.put(Tenor.ofDays(2), new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(prefix + "00" + twoDayString + " Index"))); for (int i = 1; i < 4; i++) { provider.put(Tenor.ofDays(i * 7), new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(prefix + "000" + i + "W Index"))); } for (int i = 1; i < 10; i++) { provider.put(Tenor.ofMonths(i), new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(prefix + "000" + i + "M Index"))); } for (int i = 10; i < 13; i++) { provider.put(Tenor.ofMonths(i), new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(prefix + "00" + i + "M Index"))); } return provider; }  static YieldCurveDefinition buildUSDSwapOnlyCurveDefinition(); static YieldCurveDefinition buildUSDSwapOnlyNo3YrCurveDefinition(); static YieldCurveDefinition buildUSDSwapOnly3YrCurveDefinition(); static YieldCurveDefinition buildUSDFundingCurveDefinition(); static YieldCurveDefinition buildUSDThreeMonthForwardCurveDefinition(); static YieldCurveDefinition buildEURFundingCurveDefinition(); static YieldCurveDefinition buildEURSixMonthForwardCurveDefinition(); static YieldCurveDefinition buildEURThreeMonthFutForwardCurveDefinition(); static YieldCurveDefinition buildEURThreeMonthForwardCurveDefinition(); static YieldCurveDefinition buildGBPFundingCurveDefinition(); static YieldCurveDefinition buildGBPThreeMonthForwardCurveDefinition(); static YieldCurveDefinition buildGBPSixMonthForwardCurveDefinition(); static YieldCurveDefinition buildCHFFundingCurveDefinition(); static YieldCurveDefinition buildCHFSixMonthForwardCurveDefinition(); static YieldCurveDefinition buildJPYFundingCurveDefinition(); static YieldCurveDefinition buildJPYSixMonthForwardCurveDefinition(); static YieldCurveDefinition buildCADFundingCurveDefinition(); static YieldCurveDefinition buildCADSixMonthForwardCurveDefinition(); static YieldCurveDefinition buildAUDFundingCurveDefinition(); static YieldCurveDefinition buildAUDSixMonthForwardCurveDefinition(); static YieldCurveDefinition buildNZDFundingCurveDefinition(); static YieldCurveDefinition buildNZDThreeMonthForwardCurveDefinition(); static YieldCurveDefinition buildDKKFundingCurveDefinition(); static YieldCurveDefinition buildDKKSixMonthForwardCurveDefinition(); static YieldCurveDefinition buildSecondaryDiscountingCurveDefinition(final Currency currency, final ExternalId region); static YieldCurveDefinition buildSecondaryForward3MLiborCurveDefinition(final Currency currency, final ExternalId region); static YieldCurveDefinition buildSecondaryForward6MLiborCurveDefinition(final Currency currency, final ExternalId region); static YieldCurveDefinition buildSecondaryEURSixMonthForwardCurveDefinition(); static YieldCurveDefinition buildSecondaryEURThreeMonthFutForwardCurveDefinition(); static YieldCurveDefinition buildSecondaryEURThreeMonthForwardCurveDefinition(); static YieldCurveDefinition buildSecondaryDiscountingAUDCurveDefinition(); static YieldCurveDefinition buildSecondaryForward3MBasisAUDCurveDefinition(); static YieldCurveDefinition buildSecondaryForward6MBasisAUDCurveDefinition(); static YieldCurveDefinition buildSecondarySingleAUDCurveDefinition(); static Map<String, Map<Currency, YieldCurveDefinition>> buildNewCurveDefinitions(); static Map<String, Map<Currency, YieldCurveDefinition>> buildNewBbgCurveDefinitions(); static Map<Currency, CurveSpecificationBuilderConfiguration> buildStandardCurveSpecificationBuilderConfigurations(); static Map<Currency, CurveSpecificationBuilderConfiguration> buildSyntheticCurveSpecificationBuilderConfigurations(); static CurveSpecificationBuilderConfiguration buildSyntheticAUD3MCurveSpecification(); static CurveSpecificationBuilderConfiguration buildSyntheticAUD6MCurveSpecification(); static Map<Tenor, CurveInstrumentProvider> buildStandardBloombergDepositInstrumentProvider(final String prefix); static Map<Tenor, CurveInstrumentProvider> buildStandardBloombergLiborInstrumentProvider(final String prefix, final String overnightString, final String twoDayString); static Map<Tenor, CurveInstrumentProvider> buildStandardBloombergEuriborInstrumentProvider(); static Map<Tenor, CurveInstrumentProvider> buildStandardBloombergCDORInstrumentProvider(); static Map<Tenor, CurveInstrumentProvider> buildStandardBloombergCiborInstrumentProvider(); static Map<Tenor, CurveInstrumentProvider> buildStandardBloombergStiborInstrumentProvider(); static Map<Tenor, CurveInstrumentProvider> buildStandardBloomberg3MFRAInstrumentProvider(final String prefix); static Map<Tenor, CurveInstrumentProvider> buildStandardBloomberg6MFRAInstrumentProvider(final String prefix); static Map<Tenor, CurveInstrumentProvider> buildStandardBloombergJPY6MFRAInstrumentProvider(); static Map<Tenor, CurveInstrumentProvider> buildStandardBloombergFutureInstrumentProvider(final String futurePrefix); static Map<Tenor, CurveInstrumentProvider> buildStandardBloomberg6MSwapInstrumentProvider(final String prefix); static Map<Tenor, CurveInstrumentProvider> buildStandardBloomberg3MSwapInstrumentProvider(final String prefix, final String postfix); static Map<Tenor, CurveInstrumentProvider> buildStandardBloombergOISSwapInstrumentProvider(final String prefix);  }
@Test public void testBBGLiborProvider() { final Map<Tenor, CurveInstrumentProvider> result = CurveDefinitionAndSpecifications.buildStandardBloombergLiborInstrumentProvider("BP", "S/N", "T/N"); assertEquals(result.size(), 17); assertEquals(result.get(Tenor.ofDays(1)).getInstrument(null, null), ExternalSchemes.bloombergTickerSecurityId("BP00S/N Index")); assertEquals(result.get(Tenor.ofDays(21)).getInstrument(null, null), ExternalSchemes.bloombergTickerSecurityId("BP0003W Index")); assertEquals(result.get(Tenor.ofMonths(4)).getInstrument(null, null), ExternalSchemes.bloombergTickerSecurityId("BP0004M Index")); assertEquals(result.get(Tenor.ofMonths(11)).getInstrument(null, null), ExternalSchemes.bloombergTickerSecurityId("BP0011M Index")); }