@Test public void isCoveredByTest() { AttributeMatcher attributeMatcher1 = new KeyMatcher(Arrays.asList(KEY1)); AttributeMatcher attributeMatcher2 = new KeyMatcher(Arrays.asList(KEY1)); Assert.assertTrue(attributeMatcher1.isCoveredBy(attributeMatcher1)); Assert.assertTrue(attributeMatcher1.isCoveredBy(attributeMatcher2)); Assert.assertTrue(attributeMatcher1.isCoveredBy(AnyMatcher.INSTANCE)); Assert.assertFalse(AnyMatcher.INSTANCE.isCoveredBy(attributeMatcher1)); }
@Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.keys.size()); for (int i = 0, n = this.keys.size(); i < n; ++i) { tags.add(new Tag(this.keys.get(i), null)); } return attributeMatcher.matches(tags); }
KeyMatcher implements AttributeMatcher { @Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.keys.size()); for (int i = 0, n = this.keys.size(); i < n; ++i) { tags.add(new Tag(this.keys.get(i), null)); } return attributeMatcher.matches(tags); } }
KeyMatcher implements AttributeMatcher { @Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.keys.size()); for (int i = 0, n = this.keys.size(); i < n; ++i) { tags.add(new Tag(this.keys.get(i), null)); } return attributeMatcher.matches(tags); } KeyMatcher(List<String> keys); }
KeyMatcher implements AttributeMatcher { @Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.keys.size()); for (int i = 0, n = this.keys.size(); i < n; ++i) { tags.add(new Tag(this.keys.get(i), null)); } return attributeMatcher.matches(tags); } KeyMatcher(List<String> keys); @Override boolean isCoveredBy(AttributeMatcher attributeMatcher); @Override boolean matches(List<Tag> tags); }
KeyMatcher implements AttributeMatcher { @Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.keys.size()); for (int i = 0, n = this.keys.size(); i < n; ++i) { tags.add(new Tag(this.keys.get(i), null)); } return attributeMatcher.matches(tags); } KeyMatcher(List<String> keys); @Override boolean isCoveredBy(AttributeMatcher attributeMatcher); @Override boolean matches(List<Tag> tags);  }