### Question:
XWikiValidator extends AbstractHTML5Validator { @Override protected void validate(Document document) { validateFailingMacros(); validateNotEmptyHeadingId(); validateUrlOrResourcesWithoutDoubleInterrogationMark(); }  void validateFailingMacros(); void validateNotEmptyHeadingId(); void validateUrlOrResourcesWithoutDoubleInterrogationMark(); @Override String getName();  }### Answer:
@Test public void testValid() throws Exception { validate(getClass().getResourceAsStream("/xwiki-valid.html")); List<ValidationError> errors = this.validator.getErrors(); assertTrue(errors.isEmpty()); }
@Test public void testInvalid() throws Exception { validate(getClass().getResourceAsStream("/xwiki-invalid.html")); List<ValidationError> errors = this.validator.validate(); assertEquals(errors, this.validator.getErrors()); assertEquals(3, errors.size()); assertEquals("Found rendering error", errors.get(0).getMessage()); assertEquals("A h1 heading with empty id (\"H\") has been found", errors.get(1).getMessage()); assertEquals("A h2 heading with empty id (\"H\") has been found", errors.get(2).getMessage()); this.validator.clear(); assertTrue(this.validator.getErrors().isEmpty()); }