MarketDataMatcher { public static MarketDataMatcher idLike(String scheme, String glob) { return new Like(scheme, glob); }  abstract boolean matches(ExternalIdBundle id); static MarketDataMatcher idEquals(String scheme, String value1, String... values); static MarketDataMatcher idLike(String scheme, String glob);  }
@Test public void idLike() { MarketDataMatcher valMatcher = MarketDataMatcher.idLike(SCHEME, "val*"); MarketDataMatcher valueMatcher = MarketDataMatcher.idLike(SCHEME, "value?"); MarketDataMatcher oneMatcher = MarketDataMatcher.idLike(SCHEME, "*1"); ExternalId otherId = ExternalId.of(SCHEME, "otherValue"); assertTrue(valMatcher.matches(BUNDLE1)); assertTrue(valMatcher.matches(BUNDLE2)); assertTrue(valMatcher.matches(BUNDLE3)); assertTrue(valMatcher.matches(ExternalIdBundle.of(otherId, ID1))); assertFalse(valMatcher.matches(ExternalIdBundle.of(otherId))); assertTrue(valueMatcher.matches(BUNDLE1)); assertTrue(valueMatcher.matches(BUNDLE2)); assertTrue(valueMatcher.matches(BUNDLE3)); assertTrue(valueMatcher.matches(ExternalIdBundle.of(otherId, ID1))); assertFalse(valueMatcher.matches(ExternalIdBundle.of(otherId))); assertTrue(oneMatcher.matches(BUNDLE1)); assertFalse(oneMatcher.matches(BUNDLE2)); assertFalse(oneMatcher.matches(BUNDLE3)); assertTrue(oneMatcher.matches(ExternalIdBundle.of(ID1, ID2))); assertFalse(oneMatcher.matches(ExternalIdBundle.of(ID3, ID2))); }