### Question:
TitleForInlineFrameRule extends AbstractRule { @Override protected void applyTo(Page page, Violations violations) { for (HtmlInlineFrame inlineFrame : page.findAllInlineFrameTags()) { if (!hasNonEmptyAttribute(inlineFrame, "title")) { violations.add(createViolation(inlineFrame, page, RULE_MESSAGE)); } } }  @Override String getName();  }### Answer:
@Test public void inlineFrameWithoutTitlePresent() throws Exception { String content = "<html><body><iframe src=\"nav.html\" /></body></html>"; Violations violations = rule.applyTo(toHtmlPage(content)); assertViolations(violations, rule, 1); }
@Test public void inlineFrameWithTitlePresent() throws Exception { String content = "<html><body><iframe title=\"Navigation\" src=\"nav.html\" /></body></html>"; Violations violations = rule.applyTo(toHtmlPage(content)); assertNoViolations(violations, rule); }