* @param changeTypes The types to search for
* @param closure The closure to invoke
*/
protected void applyForSelectedChanges(Collection changes, Class[] changeTypes, final Closure closure)
{
final Predicate predicate = new MultiInstanceofPredicate(changeTypes);
// basically we filter the changes for all objects where the above predicate
// returns true, and for these filtered objects we invoke the given closure
CollectionUtils.filter(changes,
new Predicate()
{
public boolean evaluate(Object obj)
{
if (predicate.evaluate(obj))
{
closure.execute(obj);
return false;
}
else