Set<ExternalIdWithDates> identifiers = Sets.newHashSet(
ExternalIdWithDates.of(ExternalSchemes.bloombergTickerSecurityId("EDU0 Comdty"),
LocalDate.of(2010, Month.SEPTEMBER, 14), LocalDate.of(2020, Month.SEPTEMBER, 14)),
ExternalIdWithDates.of(ExternalSchemes.bloombergBuidSecurityId("IX11084074-0"), null, null));
ExternalIdBundleWithDates withTwoDigits = BloombergDataUtils.addTwoDigitYearCode(new ExternalIdBundleWithDates(identifiers));
assertTrue(withTwoDigits.size() == 3);
for (ExternalIdWithDates identifierWithDates : identifiers) {
assertTrue(withTwoDigits.contains(identifierWithDates));
}
assertTrue(withTwoDigits.contains(ExternalIdWithDates.of(
ExternalSchemes.bloombergTickerSecurityId("EDU20 Comdty"),
LocalDate.of(2010, Month.SEPTEMBER, 14), LocalDate.of(2020, Month.SEPTEMBER, 14))));
identifiers = Sets.newHashSet(
ExternalIdWithDates.of(ExternalSchemes.bloombergTickerSecurityId("EDU09 Comdty"),
LocalDate.of(1999, Month.SEPTEMBER, 14), LocalDate.of(2009, Month.SEPTEMBER, 14)),
ExternalIdWithDates.of(ExternalSchemes.bloombergBuidSecurityId("IX9471080-0"), null, null));
withTwoDigits = BloombergDataUtils.addTwoDigitYearCode(new ExternalIdBundleWithDates(identifiers));
assertTrue(withTwoDigits.size() == 3);
for (ExternalIdWithDates identifierWithDates : identifiers) {
assertTrue(withTwoDigits.contains(identifierWithDates));
}
assertTrue(withTwoDigits.contains(ExternalIdWithDates.of(
ExternalSchemes.bloombergTickerSecurityId("EDU9 Comdty"),
LocalDate.of(1999, Month.SEPTEMBER, 14), LocalDate.of(2009, Month.SEPTEMBER, 14))));
}