@Test
public void testGetReportedViolations() {

    final DefaultErrorListener errorListener = new DefaultErrorListener();
    errorListener.reportViolation(new SimpleViolation(Severity.MINOR, "minor"));
    errorListener.reportViolation(new SimpleViolation(Severity.MAJOR, "major"));
    errorListener.reportViolation(new SimpleViolation(Severity.SEVERE, "severe"));
    assertEquals("should have reported", 3, errorListener.getReportedViolations().size());
}