### Question:
Violations { @Override public String toString() { StringBuilder sb = new StringBuilder(); if (!hasViolations()) { sb.append("No violations found."); } else { sb.append("Found violations:"); int num = 1; for (Violation violation : violations) { sb.append("\n").append(num++).append(") ").append(violation); } } return sb.toString(); }  void add(Violation violation); void addAll(Violations violations); boolean hasViolations(); int size(); List<Violation> asList(); @Override String toString();  }### Answer:
@Test public void toStringForNoViolationsGivesCorrectFeedback() throws Exception { Violations violations = new Violations(); assertEquals("No violations found.", violations.toString()); }