CurveDefinitionAndSpecifications { public static Map<Tenor, CurveInstrumentProvider> buildStandardBloomberg6MFRAInstrumentProvider(final String prefix) { final Map<Tenor, CurveInstrumentProvider> provider = new LinkedHashMap<>(); provider.put(Tenor.ofMonths(6), new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(prefix + "FR00F Curncy"))); for (int i = 1; i < 22; i++) { final int year = i / 12; final int month = i % 12; String startTenor, endTenor6M; if (month == 0) { startTenor = "0" + String.valueOf(year); } else { startTenor = String.valueOf(year) + BBG_MONTH_CODES[month - 1]; } final int endYear6M = (i + 6) / 12; final int endMonth6M = (i + 6) % 12; if (endMonth6M == 0) { endTenor6M = String.valueOf(endYear6M); } else { endTenor6M = (endYear6M > 0 ? String.valueOf(endYear6M) : "") + BBG_MONTH_CODES[endMonth6M - 1]; } provider.put(Tenor.ofMonths(i + 6), new StaticCurveInstrumentProvider(ExternalSchemes.bloombergTickerSecurityId(prefix + "FR" + startTenor + endTenor6M + " Curncy"))); } 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 testBBG6MFRAProvider() { final Map<Tenor, CurveInstrumentProvider> result = CurveDefinitionAndSpecifications.buildStandardBloomberg6MFRAInstrumentProvider("US"); assertEquals(result.size(), 22); assertEquals(result.get(Tenor.SIX_MONTHS).getInstrument(null, null), ExternalSchemes.bloombergTickerSecurityId("USFR00F Curncy")); assertEquals(result.get(Tenor.ELEVEN_MONTHS).getInstrument(null, null), ExternalSchemes.bloombergTickerSecurityId("USFR0EK Curncy")); assertEquals(result.get(Tenor.ofMonths(18)).getInstrument(null, null), ExternalSchemes.bloombergTickerSecurityId("USFR011F Curncy")); assertEquals(result.get(Tenor.ofMonths(21)).getInstrument(null, null), ExternalSchemes.bloombergTickerSecurityId("USFR1C1I Curncy")); assertFalse(result.containsKey(Tenor.ofYears(1))); }