### Question:
AvoidAbstractRoleRule extends AbstractRule { @Override protected void applyTo(Page page, Violations violations) { List<HtmlElement> elements = page.findAllElementsWithAttribute("role"); for (HtmlElement element : elements) { String roleValue = element.getAttribute("role"); if (roleValue != null && !roleValue.isEmpty() && ABSTRACT_ROLES.contains(roleValue)) { violations.add(createViolation(element, page, RULE_MESSAGE)); } } }  @Override String getName();  }### Answer:
@Test public void landmarkRoleBannerPresentCausesNoViolation() throws Exception { String content = "<html><body><div role=\"banner\">Content</div></body></html>"; Violations violations = rule.applyTo(toHtmlPage(content)); assertNoViolations(violations, rule); }