@Test public void isCoveredByTest() { AttributeMatcher attributeMatcher1 = new ValueMatcher(Arrays.asList(VALUE1)); AttributeMatcher attributeMatcher2 = new ValueMatcher(Arrays.asList(VALUE1)); 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.values.size()); for (int i = 0, n = this.values.size(); i < n; ++i) { tags.add(new Tag(null, this.values.get(i))); } return attributeMatcher.matches(tags); }
ValueMatcher implements AttributeMatcher { @Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.values.size()); for (int i = 0, n = this.values.size(); i < n; ++i) { tags.add(new Tag(null, this.values.get(i))); } return attributeMatcher.matches(tags); } }
ValueMatcher implements AttributeMatcher { @Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.values.size()); for (int i = 0, n = this.values.size(); i < n; ++i) { tags.add(new Tag(null, this.values.get(i))); } return attributeMatcher.matches(tags); } ValueMatcher(List<String> values); }
ValueMatcher implements AttributeMatcher { @Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.values.size()); for (int i = 0, n = this.values.size(); i < n; ++i) { tags.add(new Tag(null, this.values.get(i))); } return attributeMatcher.matches(tags); } ValueMatcher(List<String> values); @Override boolean isCoveredBy(AttributeMatcher attributeMatcher); @Override boolean matches(List<Tag> tags); }
ValueMatcher implements AttributeMatcher { @Override public boolean isCoveredBy(AttributeMatcher attributeMatcher) { if (attributeMatcher == this) { return true; } List<Tag> tags = new ArrayList<Tag>(this.values.size()); for (int i = 0, n = this.values.size(); i < n; ++i) { tags.add(new Tag(null, this.values.get(i))); } return attributeMatcher.matches(tags); } ValueMatcher(List<String> values); @Override boolean isCoveredBy(AttributeMatcher attributeMatcher); @Override boolean matches(List<Tag> tags);  }