Function<Type, Iterable<Class<? extends Constraint<?, ?>>>> function = new Function<Type, Iterable<Class<? extends Constraint<?, ?>>>>()
{
@Override
public Iterable<Class<? extends Constraint<?, ?>>> map( Type type )
{
Constraints constraints = Annotations.annotationOn( type, Constraints.class );
if( constraints == null )
{
return empty();
}
else
{
return iterable( constraints.value() );
}
}
};
Iterable<Class<? extends Constraint<?, ?>>> flatten = flattenIterables( map( function, allTypes ) );
return toList( flatten );