MarketDataMatcher { public static MarketDataMatcher idEquals(String scheme, String value1, String... values) { ArgumentChecker.notEmpty(scheme, "scheme"); ArgumentChecker.notEmpty(value1, "value1"); Set<ExternalId> ids = new HashSet<>(values.length + 1); ids.add(ExternalId.of(scheme, value1)); for (String value : values) { if (StringUtils.isEmpty(value)) { throw new IllegalArgumentException("External ID values must not be empty"); } ids.add(ExternalId.of(scheme, value)); } return new Equals(ids); }  abstract boolean matches(ExternalIdBundle id); static MarketDataMatcher idEquals(String scheme, String value1, String... values); static MarketDataMatcher idLike(String scheme, String glob);  }
@Test public void idEquals() { MarketDataMatcher matcher = MarketDataMatcher.idEquals(SCHEME, VALUE1); assertTrue(matcher.matches(BUNDLE1)); assertFalse(matcher.matches(BUNDLE2)); ExternalIdBundle id = ExternalIdBundle.of(ID1, ID2); assertTrue(matcher.matches(id)); }