### Question:
IdeaReportParser { public Collection<Violation> getViolations() { return violations; } IdeaReportParser(File reportDir); Collection<Violation> getViolations(); void parseAll();  }### Answer:
@Test public void testGetViolations() { IdeaReportParser parser = new IdeaReportParser(TestUtils.getResource(REPORT_DIR)); parser.parseAll(); Collection<IdeaReportParser.Violation> violations = parser.getViolations(); assertThat(violations.size(), is(13)); IdeaReportParser.Violation violation = violations.iterator().next(); assertThat(violation.getType(), is("RedundantCast")); assertThat(violation.getDescription(), is("Casting <code>t.tree</code> to <code>Node</code> is redundant")); assertThat(violation.getLine(), is(467)); assertThat(violation.getSonarJavaFileKey(), is("elg.conj.C")); assertThat(violation.getSourcePath(), is("target/generated-sources/antlr3/elg/conj/C.java")); assertThat(violation.getModule(), is("conj")); }