public void testValidateNestedPropertyPath() throws InvocationTargetException,
NoSuchMethodException, IllegalAccessException {
final String propPath = "addresses[0].country.ISO2Code";
Validator v = getValidator();
Author author = new Author();
author.setAddresses(new ArrayList());
Address adr = new Address();
author.getAddresses().add(adr);
Country country = new Country();
adr.setCountry(country);
country.setISO2Code("too_long");
Set<ConstraintViolation<Author>> iv = v.validateProperty(author, propPath);
Assert.assertEquals(1, iv.size());
country.setISO2Code("23");
iv = v.validateProperty(author, propPath);
Assert.assertEquals(0, iv.size());
iv = v.validateValue(Author.class, propPath, "345");
Assert.assertEquals(1, iv.size());
iv = v.validateValue(Author.class, propPath, "34");
Assert.assertEquals(0, iv.size());
}