fixed test replaceViolations function