@SuppressWarnings("unchecked")
protected Set<ValidationError> validateCollectionConstraint(final Field field, final Object collection) {
Set<ValidationError> errors = new HashSet<ValidationError>();
CollectionConstraint collectionConstraint = field.getAnnotation(CollectionConstraint.class);
if (collectionConstraint != null) {
if (collectionConstraint.required() & (collection == null)) errors.add(new ValidationError(field.getName(), errorCodes[0], collectionConstraint, collection));
if (collection != null) {
if (Collection.class.isInstance(collection)) {
Collection<?> col = (Collection<?>) collection;
if (collectionConstraint.traverse()) {
Collection<ValidationError> deepErrors = new HashSet<ValidationError>();