@Test
public void testFromReported() {

    final Severity severity = Severity.MINOR;
    final PackageId packId = PackageId.fromString("my_pack");
    final String description = "some description";
    final Violation violation = new Violation() {
        @Override
        public Severity getSeverity() {
            return severity;
        }
        @Override
        public Collection<PackageId> getPackages() {
            return Collections.singletonList(packId);
        }
        @Override
        public String getDescription() {
            return description;
        }
    };
    final SimpleViolation simpleViolation = SimpleViolation.fromReported(violation);
    assertSame("expect same severity", severity, simpleViolation.getSeverity());
    assertEquals("expect equal packageIds", Collections.singletonList(packId),
            simpleViolation.getPackages());
    assertSame("expect same description", description, simpleViolation.getDescription());
}