@Test
public void toJSONWithCauses() {

    ValidationException cause =
            new ValidationException(NullSchema.INSTANCE,
                    new StringBuilder("#/a/0"),
                    "cause msg",
                    emptyList(),
                    "type",
                    null);
    ValidationException subject =
            new ValidationException(BooleanSchema.INSTANCE, new StringBuilder("#/a"),
                    "exception message", Arrays.asList(cause), "type", null);
    JSONObject expected = ResourceLoader.DEFAULT.readObj("exception-to-json-with-causes.json");
    JSONObject actual = subject.toJSON();
    assertThat(actual, sameJsonAs(expected));
}