//Use a local variable to avoid to wait at each access.
Collection col = fs;
if (col != null) {
Iterator it = col.iterator(); // Get the cached copy
while (it != null && it.hasNext()) {
FooService svc = (FooService) it.next();
result = result && svc.foo();
}
}
return result;
}