### Question:
ValidationResult implements Serializable { public boolean hasFailures() { return !failures.isEmpty(); } 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 testHasFailures() { res = new ValidationResult(); res.addFailure(new BeanValidationFailure(obj1, "obj1 1", "mes obj1 1")); assertTrue(res.hasFailures()); assertTrue(res.hasFailures(obj1)); assertFalse(res.hasFailures(obj2)); }
@Test public void testEmpty() { res = new ValidationResult(); assertFalse(res.hasFailures()); assertFalse(res.hasFailures(obj1)); assertFalse(res.hasFailures(null)); }