@Test
public void throwsExceptionOnViolation() throws Exception {

    Assertions.assertThrows(
        ValidationException.class,
        () -> {
            final byte[] bytecode = new BytecodeMocker()
                .withSource(
                    "class Foo { public Foo clone() { return this; } }"
                ).mock();
            final Environment env = new Environment.Mock()
                .withFile("target/classes/Foo.class", bytecode)
                .withDefaultClasspath();
            new FindBugsValidator().validate(env);
        }
    );
}