### Question:
KeyMatcher implements AttributeMatcher { @Override public boolean matches(List<Tag> tags) { for (int i = 0, n = tags.size(); i < n; ++i) { if (this.keys.contains(tags.get(i).key)) { return true; } } return false; } KeyMatcher(List<String> keys); @Override boolean isCoveredBy(AttributeMatcher attributeMatcher); @Override boolean matches(List<Tag> tags);  }### Answer:
@Test public void matchesTest() { Tag tag1 = new Tag(KEY1, null); Tag tag2 = new Tag(KEY2, null); AttributeMatcher attributeMatcher = new KeyMatcher(Arrays.asList(KEY1)); Assert.assertTrue(attributeMatcher.matches(Arrays.asList(tag1))); Assert.assertFalse(attributeMatcher.matches(Arrays.asList(tag2))); }