ValidationException extends RuntimeException { private static int getViolationCount(List<ValidationException> causes) { int causeCount = causes.stream().mapToInt(ValidationException::getViolationCount).sum(); return Math.max(1, causeCount); } @Deprecated  ValidationException(Class<?> expectedType, Object actualValue);  ValidationException(Schema violatedSchema, Class<?> expectedType,
            Object actualValue); @Deprecated  ValidationException(Schema violatedSchema, Class<?> expectedType,
            Object actualValue, String keyword);  ValidationException(Schema violatedSchema, Class<?> expectedType,
            Object actualValue, String keyword, String schemaLocation); @Deprecated  ValidationException(Schema violatedSchema, String message); @Deprecated  ValidationException(Schema violatedSchema,
            String message,
            String keyword);  ValidationException(Schema violatedSchema,
            String message,
            String keyword,
            String schemaLocation); @Deprecated  ValidationException(Schema violatedSchema, StringBuilder pointerToViolation,
            String message,
            List<ValidationException> causingExceptions);   ValidationException(Schema violatedSchema, StringBuilder pointerToViolation,
            String message,
            List<ValidationException> causingExceptions,
            String keyword,
            String schemaLocation); @Deprecated  ValidationException(String message); private  ValidationException(StringBuilder pointerToViolation,
            Schema violatedSchema,
            String message,
            List<ValidationException> causingExceptions,
            String keyword, String schemaLocation); @Deprecated  ValidationException(Schema violatedSchema, String message,
            List<ValidationException> causingExceptions); static void throwFor(Schema rootFailingSchema,
            List<ValidationException> failures); List<ValidationException> getCausingExceptions(); List<String> getAllMessages(); @Override String getMessage(); String getErrorMessage(); String getPointerToViolation(); Schema getViolatedSchema(); ValidationException prepend(String fragment); ValidationException prepend(String fragment, Schema violatedSchema); int getViolationCount(); String getKeyword(); JSONObject toJSON(); String getSchemaLocation(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void violationCountWithoutCauses() { ValidationException subject = subjectWithCauses(); assertEquals(1, subject.getViolationCount()); }
@Test public void violationCountWithCauses() { ValidationException subject = subjectWithCauses(subjectWithCauses(), subjectWithCauses()); assertEquals(2, subject.getViolationCount()); }
@Test public void violationCountWithNestedCauses() { ValidationException subject = subjectWithCauses( subjectWithCauses(), subjectWithCauses(subjectWithCauses(), subjectWithCauses(subjectWithCauses(), subjectWithCauses()))); assertEquals(4, subject.getViolationCount()); }