### Question:
ValidationResult implements Serializable { public List<ValidationFailure> getFailures() { return Collections.unmodifiableList(failures); } ValidationResult(); void addFailure(ValidationFailure failure); List<ValidationFailure> getFailures(); List<ValidationFailure> getFailures(Object source); boolean hasFailures(); boolean hasFailures(Object source); void clear(); @Override String toString();  }### Answer:
@Test public void testGetFailures() { res = new ValidationResult(); res.addFailure(new BeanValidationFailure(obj1, "obj1 1", "mes obj1 1")); res.addFailure(new BeanValidationFailure(obj1, "obj1 1", "mes obj1 1")); res.addFailure(new BeanValidationFailure(obj2, "obj1 1", "mes obj1 1")); assertEquals(2, res.getFailures(obj1).size()); assertEquals(1, res.getFailures(obj2).size()); assertEquals(3, res.getFailures().size()); }