ValidationException extends RuntimeException { public static void throwFor(Schema rootFailingSchema, List<ValidationException> failures) { int failureCount = failures.size(); if (failureCount == 0) { return; } else if (failureCount == 1) { throw failures.get(0); } else { throw createWrappingException(rootFailingSchema, failures); } } @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 throwForNoFailure() { ValidationException.throwFor(rootSchema, emptyList()); }
@Test public void throwForSingleFailure() { ValidationException input = new ValidationException(NullSchema.INSTANCE, "msg"); try { ValidationException.throwFor(rootSchema, Arrays.asList(input)); Assert.fail("did not throw exception for single failure"); } catch (ValidationException actual) { Assert.assertSame(input, actual); } }