ValidationViolation extends ValidationMessage { public static final Collection<ValidationViolation> wrapMessages(String validatorId, Collection<? extends ValidationMessage> messages, Path filePath, Path basePath, String nodePath, int line, int column) { Collection<ValidationViolation> violations = new LinkedList<>(); for (ValidationMessage message : messages) { violations.add(wrapMessage(validatorId, message, filePath, basePath, nodePath, line, column)); } return violations; } ValidationViolation(String validatorId, ValidationMessage message, Path filePath, Path basePath, String nodePath, int line, int column, Throwable t); private  ValidationViolation(String validatorId, ValidationMessage message);  ValidationViolation(String validatorId, @NotNull ValidationMessageSeverity severity, @NotNull String message);  ValidationViolation(@NotNull ValidationMessageSeverity severity, @NotNull String message);  ValidationViolation(@NotNull ValidationMessageSeverity severity, @NotNull String message, Path filePath, Path basePath, String nodePath, int line, int column, Throwable t);  ValidationViolation(String validatorId, @NotNull ValidationMessageSeverity severity, @NotNull String message, Path filePath, Path basePath, String nodePath, int line, int column, Throwable t); static final Collection<ValidationViolation> wrapMessages(String validatorId, Collection<? extends ValidationMessage> messages, Path filePath, Path basePath, String nodePath, int line, int column); static final ValidationViolation wrapMessage(String validatorId, ValidationMessage message, Path filePath, Path basePath, String nodePath, int line, int column); @Nullable Path getAbsoluteFilePath(); @Nullable String getValidatorId(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testWrapMessagesNoOverwrite() { Collection<ValidationViolation> violations = ValidationViolation.wrapMessages(null, messages, null, null, null, 0, 0); ValidationExecutorTest.assertViolation(violations, ValidationMessageSeverity.DEBUG, new ValidationViolation(ValidationMessageSeverity.DEBUG, "message1"), new ValidationViolation(null, ValidationMessageSeverity.INFO, "message2", null, null, null, 1, 2, myThrowable1), ValidationViolation.class.cast(messages.get(2)), ValidationViolation.class.cast(messages.get(3))); }
@Test public void testWrapMessagesFullOverwrite() { Collection<ValidationViolation> violations = ValidationViolation.wrapMessages("myid2", messages, Paths.get("child1"), Paths.get("base1"), "nodepath2", 10, 20); ValidationExecutorTest.assertViolation(violations, ValidationMessageSeverity.DEBUG, new ValidationViolation("myid2", ValidationMessageSeverity.DEBUG, "message1", Paths.get("child1"), Paths.get("base1"), "nodepath2", 10, 20, null), new ValidationViolation("myid2", ValidationMessageSeverity.INFO, "message2", Paths.get("child1"), Paths.get("base1"), "nodepath2", 1, 2, null), new ValidationViolation("myid", ValidationMessageSeverity.ERROR, "message3", Paths.get("child"), Paths.get("base1"), "nodepath1", 3, 4, myThrowable2), new ValidationViolation("myid", ValidationMessageSeverity.ERROR, "message4", Paths.get("child"), Paths.get("base"), "nodepath1", 3, 4, myThrowable2)); }